From abceeee92f99b84ebb79968269835a4f509bfb90 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 14 Nov 2011 00:19:48 +0200 Subject: Create framework for getting rid of global definitions of node/tool/item/whatever types --- src/scriptapi.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 27f46a8ac..7b9a89f57 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -478,7 +478,11 @@ private: <<" itemstring=\""<getEnv(); + assert(env); + IGameDef *gamedef = env->getGameDef(); + InventoryItem *item = InventoryItem::deSerialize(is, gamedef); + infostream<<"item="<addToInventory(item); // Return lua_pushboolean(L, fits); @@ -557,7 +561,8 @@ const luaL_reg ObjectRef::methods[] = { }; // Creates a new anonymous reference if id=0 -static void objectref_get_or_create(lua_State *L, ServerActiveObject *cobj) +static void objectref_get_or_create(lua_State *L, + ServerActiveObject *cobj) { if(cobj->getId() == 0){ ObjectRef::create(L, cobj); -- cgit v1.2.3