aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsavilli <78875209+savilli@users.noreply.github.com>2021-02-23 21:36:55 +0300
committerGitHub <noreply@github.com>2021-02-23 19:36:55 +0100
commit29681085b9762e8cf0e953014ca0e8d2890713ef (patch)
treef705e77ab8ad22d5bc49ae81ea8ce51280442806
parentbbf4f7ae54ccdac0598003bbd8d3e549ddf3e565 (diff)
downloadminetest-29681085b9762e8cf0e953014ca0e8d2890713ef.tar.gz
minetest-29681085b9762e8cf0e953014ca0e8d2890713ef.tar.bz2
minetest-29681085b9762e8cf0e953014ca0e8d2890713ef.zip
Fix wrong number of items in allow_metadata_inventory_put/take callbacks (#10990)
-rw-r--r--src/inventorymanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp
index 554708e8e..1e81c1dbc 100644
--- a/src/inventorymanager.cpp
+++ b/src/inventorymanager.cpp
@@ -340,7 +340,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
*/
ItemStack src_item = list_from->getItem(from_i);
- if (count > 0)
+ if (count > 0 && count < src_item.count)
src_item.count = count;
if (src_item.empty())
return;