/******************************************************************************/
void push_inventory(lua_State *L, Inventory *inventory)
{
+ if (! inventory)
+ throw SerializationError("Attempt to push nonexistant inventory");
std::vector<const InventoryList*> lists = inventory->getLists();
std::vector<const InventoryList*>::iterator iter = lists.begin();
lua_createtable(L, 0, lists.size());
} else {
push_objectRef(L, pointed.object_id);
}
-
+
lua_setfield(L, -2, "ref");
} else {
lua_pushstring(L, "nothing");
void push_physics_override(lua_State *L, float speed, float jump, float gravity, bool sneak, bool sneak_glitch, bool new_move)
{
lua_createtable(L, 0, 6);
-
+
lua_pushnumber(L, speed);
lua_setfield(L, -2, "speed");