We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 524442f commit 904b05bCopy full SHA for 904b05b
src/script/lua_api/l_item.cpp
@@ -414,7 +414,9 @@ ItemStack& LuaItemStack::getItem()
414
int LuaItemStack::create_object(lua_State *L)
415
{
416
NO_MAP_LOCK_REQUIRED;
417
- ItemStack item = read_item(L, 1, getGameDef(L)->idef());
+ ItemStack item;
418
+ if (!lua_isnone(L, 1))
419
+ item = read_item(L, 1, getGameDef(L)->idef());
420
LuaItemStack *o = new LuaItemStack(item);
421
*(void **)(lua_newuserdata(L, sizeof(void *))) = o;
422
luaL_getmetatable(L, className);
0 commit comments