diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-12-02 02:04:25 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-02 02:04:25 +0200 |
commit | dc05b106f2011fe7e339a62b0ac15fab4fd54a91 (patch) | |
tree | bc233c22a263d2c0fac8fe606c792945d2f09d5d /src | |
parent | a416cf7c45d6e23811d4de5a460caf977771eb53 (diff) | |
download | minetest-dc05b106f2011fe7e339a62b0ac15fab4fd54a91.tar.gz minetest-dc05b106f2011fe7e339a62b0ac15fab4fd54a91.tar.bz2 minetest-dc05b106f2011fe7e339a62b0ac15fab4fd54a91.zip |
Fix the previous commit
Diffstat (limited to 'src')
-rw-r--r-- | src/scriptapi.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 359c14482..951ff6f83 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<std::string>::const_iterator i = items.begin(); i != items.end(); i++){ |