From: Perttu Ahola Date: Fri, 2 Dec 2011 00:04:25 +0000 (+0200) Subject: Fix the previous commit X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=dc05b106f2011fe7e339a62b0ac15fab4fd54a91;p=zefram%2Fminetest%2Fminetest_engine.git Fix the previous commit --- diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 359c1448..951ff6f8 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -420,7 +420,8 @@ static void inventory_set_list_from_lua(Inventory *inv, const char *name, // removes value, keeps key for next iteration lua_pop(L, 1); } - InventoryList *invlist = inv->addList(name, items.size()); + int listsize = (forcesize != -1) ? forcesize : items.size(); + InventoryList *invlist = inv->addList(name, listsize); int index = 0; for(std::list::const_iterator i = items.begin(); i != items.end(); i++){