From 0d256c17b55153207da156d2c03cd8142fe09926 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 18 Feb 2024 17:57:17 -0600 Subject: [PATCH] resource merchant work --- src/engine/net/client/ClientMessagePump.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 9af7ab6e..65aa1c68 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -1577,22 +1577,21 @@ public class ClientMessagePump implements NetMsgHandler { return; if (buy != null) { - + 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); + } msg.setItem(buy); //send the buy message back to update player // msg.setItemType(buy.getObjectType().ordinal()); // msg.setItemID(buy.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); - 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(); - } + itemMan.updateInventory(); + } } finally { origin.buyLock.unlock(); }