diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index bcffbd21..0cd796cd 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1389,7 +1389,15 @@ public class ClientMessagePump implements NetMsgHandler { return; Item buy = null; - + if(npc.getName().equals("Resource Merchant")) { + MobLoot resource = new MobLoot(npc, ItemBase.getItemBase(msg.getItemID()), 1, true); + resource.setValue(Warehouse.getCostForResource(msg.getItemID())); + npc.getCharItemManager().addItemToInventory(resource); + npc.getCharItemManager().updateInventory(resource, true); + Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); + DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + itemMan.updateInventory(); + } if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) { ArrayList sellInventory = npc.getContract().getSellInventory(); if (sellInventory == null) @@ -1583,15 +1591,9 @@ public class ClientMessagePump implements NetMsgHandler { // msg.setItemID(buy.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); - - itemMan.updateInventory(); - } - if(npc.getName().equals("Resource Merchant")) { - MobLoot resource = new MobLoot(npc, ItemBase.getItemBase(buy.getItemBaseID()), 1, true); - resource.setValue(Warehouse.getCostForResource(buy.getItemBaseID())); - npc.getCharItemManager().addItemToInventory(resource); - npc.getCharItemManager().updateInventory(resource, true); + itemMan.updateInventory(); } + } finally { origin.buyLock.unlock(); }