From d58d4857b05bb4e0fa9680f943ae386a81297814 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Sun, 9 Jul 2023 04:51:10 +0000 Subject: [PATCH] removeItem now validates item quantities prior to attempting removal --- Server/src/main/core/game/container/Container.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/src/main/core/game/container/Container.java b/Server/src/main/core/game/container/Container.java index bc7c099c6..58c242dba 100644 --- a/Server/src/main/core/game/container/Container.java +++ b/Server/src/main/core/game/container/Container.java @@ -330,6 +330,8 @@ public class Container { */ @CheckReturnValue public boolean remove(Item item, int slot, boolean fireListener) { + if (!contains(item.getId(), item.getAmount())) + return false; Item oldItem = items[slot]; if (oldItem == null || oldItem.getId() != item.getId()) { return false;