From 4fa5ccf41699a2c308fb58a42f1dd5751c7a388b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 25 Mar 2024 04:26:55 -0400 Subject: [PATCH] Value logic update --- src/engine/objects/Item.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 35f3c6f5..1139834e 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -160,6 +160,9 @@ public class Item extends AbstractWorldObject { this.dateToUpgrade = rs.getLong("item_dateToUpgrade"); this.value = rs.getInt("item_value"); + if (this.value == 0) + this.value = this.template.item_value; + } public static void _serializeForClientMsg(Item item, ByteBufferWriter writer) @@ -245,7 +248,7 @@ public class Item extends AbstractWorldObject { } else writer.putInt(item.numberOfItems); // Amount of gold } else - writer.putInt(item.template.item_value); + writer.putInt(item.value); writer.putInt(item.getValue());