Well, I just spent the better part of a day debugging a 5-line piece of code. My head hurts.
However, it may wind up being something to fix in GD, but a question first...
If I do an Intersect test, and one of my surface pointers is bad (i.e., null, or some gibberish), will Intersect return any specific error code?
That's what my problem was... I had an array of surfaces*, and I was checking intersects on them with another surface. Turns out that under certain specific circumstances, my array bounds was overshot and I was passing God knows what to the Intersect function.
I didn't bother checking the return code because as soon as I realized the path through my code was doing that, I fixed it and was happy (read: RELIEVED AS HELL!).
So, if it DOESN'T return a specific code Johan, you may want to add such a test as a trivial rejection. If it does already do this, obviously ignore this, I'll just have to check the return code next time if I'm doing something "risky" like dealing with arrays of surfaces with a changing index.
However, it may wind up being something to fix in GD, but a question first...
If I do an Intersect test, and one of my surface pointers is bad (i.e., null, or some gibberish), will Intersect return any specific error code?
That's what my problem was... I had an array of surfaces*, and I was checking intersects on them with another surface. Turns out that under certain specific circumstances, my array bounds was overshot and I was passing God knows what to the Intersect function.
I didn't bother checking the return code because as soon as I realized the path through my code was doing that, I fixed it and was happy (read: RELIEVED AS HELL!).
So, if it DOESN'T return a specific code Johan, you may want to add such a test as a trivial rejection. If it does already do this, obviously ignore this, I'll just have to check the return code next time if I'm doing something "risky" like dealing with arrays of surfaces with a changing index.