From 54cd1c59f76ff982bfde30da9d52d241844004cc Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 25 Mar 2024 06:04:32 -0400 Subject: [PATCH] Value is only an override --- src/engine/db/handlers/dbItemHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index c041b88d..c630a8e2 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -548,6 +548,11 @@ public class dbItemHandler extends dbHandlerBase { public boolean UPDATE_VALUE(Item item, int value) { + // Write 0 if we will not modify the value from template + + if (item.value == item.template.item_value) + value = 0; + try (Connection connection = DbManager.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `item_value`=? WHERE `UID` = ?")) {