Attempt to fix SEGFAULT in push_inventory
This commit is contained in:
parent
d1c84ada2b
commit
d3780cefd1
@ -1313,6 +1313,8 @@ void push_tool_capabilities(lua_State *L,
|
||||
/******************************************************************************/
|
||||
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());
|
||||
@ -1869,7 +1871,7 @@ void push_pointed_thing(lua_State *L, const PointedThing &pointed, bool csm,
|
||||
} else {
|
||||
push_objectRef(L, pointed.object_id);
|
||||
}
|
||||
|
||||
|
||||
lua_setfield(L, -2, "ref");
|
||||
} else {
|
||||
lua_pushstring(L, "nothing");
|
||||
@ -2129,7 +2131,7 @@ void push_collision_move_result(lua_State *L, const collisionMoveResult &res)
|
||||
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");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user