Topic: MScript::getInteger
I've been running through my code, trying to expose some helpful things to lua (like messages in my message system) and I was trying to sort one thing, and something felt a bit wrong, so I checked it up. MScript::getInteger (and other get functions) take unsigned int.
Checking a previous project, indices are usually negative... I just checked the actual code and you're doing arg+1, which I assume was meant to be, as a C programmer, people would be used to asking for 0 .. n-1 rather than 1 .. n. I think it's possible to hack it by casting the sign off... but I think the "nicer" way to do it might be to do something like lua_tointeger(m_state, arg - getArgsNumber());
Wondering if I am still early enough to submit this "fix" in time for the builds... or if it was done like that for a reason I can't see?
Last edited by Nistur (2012-08-05 20:24:20)