From d7eef4c623fc2cbc0f5567e668c7865e630692b0 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 23 Mar 2024 19:39:38 -0400 Subject: [PATCH] Logic update in byfromnpc --- src/engine/net/client/handlers/BuyFromNPCMsgHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/net/client/handlers/BuyFromNPCMsgHandler.java b/src/engine/net/client/handlers/BuyFromNPCMsgHandler.java index 98734adf..900292b3 100644 --- a/src/engine/net/client/handlers/BuyFromNPCMsgHandler.java +++ b/src/engine/net/client/handlers/BuyFromNPCMsgHandler.java @@ -61,7 +61,10 @@ public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { if (gold == null) return true; - Item buy = null; + Item buy = Item.getFromCache(buyFromNPCMsg.getItemID()); + + if (buy == null) + return true; if (buyFromNPCMsg.getItemType() == Enum.GameObjectType.Item.ordinal()) { @@ -72,7 +75,7 @@ public class BuyFromNPCMsgHandler extends AbstractClientMsgHandler { for (Item me : sellInventory) { - if (me.getObjectUUID() == buyFromNPCMsg.getItemID()) { + if (me.templateID == buy.templateID) { //test room available for item if (!itemMan.hasRoomInventory(me.template.item_wt))