Got another one for you all:
I'm using TRACE_TEXTURE to determine the texture a player is standing on (for hearing purposes, as covered in a thread from last week). However, it seems to be doing strange things to the stack: depending on how much code follows it, my return values get all messed up. I'm guessing it's a stack corruption because adding a LOG_CONSOLE to track my return value "fixed" the problem, that is, until I added some more code, at which point it went haywire again. Has anybody every experienced this before?
Here's a snippet of my code where the actual call happens:
Code:
float rgfl1[3];
float rgfl2[3];
const char * pTextureName;
v_source = pPlayer->v.origin;
v_dest = pPlayer->v.origin;
v_dest.z = v_dest.z - 1000;
pPlayer->v.origin.CopyToArray(rgfl1);
v_dest.CopyToArray(rgfl2);
pTextureName = TRACE_TEXTURE( ENT(0), rgfl1, rgfl2 );
Any thoughts?
-JB