Re: ReturnFloat() crashes
You need to set the flag first. I'm using this:
// Set the "Float" flag
rdPtr->rHo.hoFlags |= HOF_FLOAT;
// Return the float
float fResult = 0.2123;
return *((long*)&fResult);
Re: ReturnFloat() crashes
rSDK ReturnFloat() sets the float flag.
Re: ReturnFloat() crashes
Yes, I am using the rSDK, sorry I forgot to mention that.
Re: ReturnFloat() crashes
I'm using the rSDK as well.
Re: ReturnFloat() crashes
So you mean I should avoid ReturnFloat() and instead do it the way you posted?
Re: ReturnFloat() crashes
Mokhtar, I did it the way you suggested, but it did not make any difference. It still crashes, same way, same spot.
I made a test expression that was just a ReturnFloat(0.123456789); and it did not crash; it worked fine. (It returned 0.123457)
So why else would it crash?
Re: ReturnFloat() crashes
Maybe it's not the return that's causing this. Perhaps you're accessing an array index out of bounds?
Re: ReturnFloat() crashes
I think it must be corruption. I put debug messages and it doesn't crash until the ReturnFloat() line, so I must be giving it some bad data. I haven't changed the code much since the pastebin I linked above..
Re: ReturnFloat() crashes
Quote:
Originally Posted by LB
I think it must be corruption.
Is this the PC of yours with the bad ram? Because bad ram can cause some really fun errors...