From dc05b106f2011fe7e339a62b0ac15fab4fd54a91 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 2 Dec 2011 02:04:25 +0200 Subject: [PATCH] Fix the previous commit --- src/scriptapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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++){ -- 2.30.2