diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2021-06-30 20:39:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 20:39:38 +0200 |
commit | f2fd4432625ee5cf0380bdd006cd1f15d053b12f (patch) | |
tree | c86099e50c53442900ea034342f9e50f9a87c603 /src/inventory.h | |
parent | 72927b73ca857acd4dc5a40a96be220d090436f3 (diff) | |
download | minetest-f2fd4432625ee5cf0380bdd006cd1f15d053b12f.tar.xz |
Inventory: Make addList() consistent (#11382)
Fixes list clearing for inv:set_list() using same size, since 2db6b07.
addList() now clears the list in all cases. Use setSize() to resize without clearing.
Diffstat (limited to 'src/inventory.h')
-rw-r--r-- | src/inventory.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inventory.h b/src/inventory.h index fbf995fab..6c84f5fd1 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -298,7 +298,7 @@ public: void serialize(std::ostream &os, bool incremental = false) const; void deSerialize(std::istream &is); - // Adds a new list or clears and resizes an existing one + // Creates a new list if none exists or truncates existing lists InventoryList * addList(const std::string &name, u32 size); InventoryList * getList(const std::string &name); const InventoryList * getList(const std::string &name) const; |