I seem to vaguely recall noticing something like the following while rewriting to C: (It's been a while, so YMMV.)
The "use-mana-and-energy" flag being returned by the Lua coda was essentially random (arbitrary) due to some sort of interface problem between the Lua and the C code. I can't really recall why, exactly, but perhaps it had something to do with using 32-bit in the return type declared in the *.pkg file versus 64-bit in the *.h file for the same function. (I recall at least one such instance, but I can't really remember if it had anything to do with this particular issue.)
Or maybe it was just a question of the Lua code not actually returning anything and the C code just assuming that something had been returned and using the un-initialized variable.
EDIT: For clarity, I'd missed a negation.
Last edited by AnonymousHero on Sun Oct 20, 2013 7:15 am, edited 1 time in total.
|