I'm using Lua as scripting language in my (C++) game. In one call (from lua to c++) I check what type is on the top of the stack:
if(lua_type(L, (0)) == LUA_TSTRING)
But sometimes lua_type(L, (0)) returns 9.
I can't seem to find any references to this (return values should be between -1 and 8 or LUA_TNONE, LUA_TNIL, ... LUA_TTHREAD).
What's happening?
/* ** Extra tags for non-values */ #define LUA_TPROTO LUA_NUMTAGS #define LUA_TUPVAL (LUA_NUMTAGS+1) #define LUA_TDEADKEY (LUA_NUMTAGS+2)
WhereLUA_NUMTAGS
is 9 – Phil Williams