Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
It seems that registering a global property in AS is a problem to me.
int KB_SPACE = 57;
r = ScriptEngine->RegisterGlobalProperty("int KB_SPACE",&KB_SPACE); assert(r>=0);
output in screen:
<br/>
It outputs 258? How is it possible?
And I checked few times, it seems like not my mistake (or is it?).
But it seems that the value that the address points to changes. Is the KB_SPACE variable in a global scope? Or is it a local variable? AngelScript stores the address of the variable, so you must make sure the variable stays valid for the duration of the script engine.
Perhaps you have some memory invasion somewhere. Have you tried setting a breakpoint to determine where the value of KB_SPACE changes?