Fix the previous commit

This commit is contained in:
Perttu Ahola 2011-12-02 02:04:25 +02:00
parent a416cf7c45
commit dc05b106f2
1 changed files with 2 additions and 1 deletions

View File

@ -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<std::string>::const_iterator
i = items.begin(); i != items.end(); i++){