Skip to content

Commit

Permalink
Player hand list: require init by mods
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SmallJoker committed Oct 4, 2018
1 parent 1413b72 commit d77f3b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion doc/lua_api.txt
Expand Up @@ -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`



Expand Down
1 change: 0 additions & 1 deletion src/player.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit d77f3b3

Please sign in to comment.