Example #1
0
   int LuaThing::getLocation(lua_State *L) {

      int n = lua_gettop(L);

      if (1 != n) {
         return luaL_error(L, "takes no arguments");
      }

      Thing *t = checkThing(L, -1);

      if (0 == t) {
         return luaL_error(L, "not a Thing!");
      }

      // pushEntity will take care of case where location is null
      LuaState::pushEntity(L, t->getLocation());
      return 1;
   }