Player hand list: require init by mods
authorSmallJoker <mk939@ymail.com>
Wed, 9 May 2018 20:24:36 +0000 (22:24 +0200)
committerSmallJoker <mk939@ymail.com>
Thu, 4 Oct 2018 18:42:38 +0000 (20:42 +0200)
Mods will now have to initialize the list/slot in order to define the default player hand.
They may use the inventory callbacks to prevent abuse of this list.

doc/lua_api.txt
src/player.cpp

index 8ae4ddb03f3a1378b0e2d821223355df12e2fa61..e144a2c8fa00c6a123969c76829008d4b804429d 100644 (file)
@@ -2257,8 +2257,10 @@ Player Inventory lists
 
 * `main`: list containing the default inventory
 * `craft`: list containing the craft input
-* `craftpreview`: list containing the craft output
+* `craftpreview`: list containing the craft prediction
+* `craftresult`: list containing the crafted output
 * `hand`: list containing an override for the empty hand
+    * Is not created automatically, use `InvRef:set_size`
 
 
 
index b700053e85c1b9c48c08b51348aa04b80996522a..ccc753834c4ce92bc885151f922d32684e8a86c5 100644 (file)
@@ -36,7 +36,6 @@ Player::Player(const char *name, IItemDefManager *idef):
 
        inventory.clear();
        inventory.addList("main", PLAYER_INVENTORY_SIZE);
-       inventory.addList("hand", 1);
        InventoryList *craft = inventory.addList("craft", 9);
        craft->setWidth(3);
        inventory.addList("craftpreview", 1);