Untitled
By: a guest | Mar 20th, 2010 | Syntax:
C | Size: 0.24 KB | Hits: 26 | Expires: Never
void luaGetInteger(luaScript* script, const char* name, int* ret){
lua_pushstring(script->L, name);
lua_gettable(script->L, -2);
if (lua_isnumber(script->L, -1)){
*ret = lua_tointeger(script->L, -1);
lua_pop(script->L, 2);
}
}