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))