Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 20th, 2010 | Syntax: C | Size: 0.24 KB | Hits: 26 | Expires: Never
Copy text to clipboard
  1. void luaGetInteger(luaScript* script, const char* name, int* ret){
  2.         lua_pushstring(script->L, name);
  3.         lua_gettable(script->L, -2);
  4.         if (lua_isnumber(script->L, -1)){
  5.                 *ret = lua_tointeger(script->L, -1);
  6.                 lua_pop(script->L, 2);
  7.         }
  8. }