From 5225898434ad096c07e2bc3ebbe11d67b4668fa9 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 14 Sep 2025 08:57:03 -0500 Subject: [PATCH] create system allowing players to delete items form inventory for gold value (junk hut in bag) --- src/engine/net/client/ClientMessagePump.java | 39 ++++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 45468b54..2f354d5a 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -564,33 +564,32 @@ public class ClientMessagePump implements NetMsgHandler { if (itemManager.delete(i)) { Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + } + } - ItemBase ib = i.getItemBase(); - - if(ib == null) - return; - - if(ib.getUUID() == 7) // don't allow gold to junk for gold - return; + ItemBase ib = i.getItemBase(); - int value = ib.getBaseValue(); + if(ib == null) + return; - Item gold = itemManager.getGoldInventory(); - int curAmt; - if (gold == null) - curAmt = 0; - else - curAmt = gold.getNumOfItems(); + if(ib.getUUID() == 7) // don't allow gold to junk for gold + return; - if ((curAmt + value) > MBServerStatics.PLAYER_GOLD_LIMIT) { - ChatManager.chatSystemInfo(sourcePlayer, "This would place your inventory over " + MBServerStatics.PLAYER_GOLD_LIMIT + " gold."); - return; - } + int value = ib.getBaseValue(); - itemManager.addGoldToInventory(value, false); + Item gold = itemManager.getGoldInventory(); + int curAmt; + if (gold == null) + curAmt = 0; + else + curAmt = gold.getNumOfItems(); - } + if ((curAmt + value) > MBServerStatics.PLAYER_GOLD_LIMIT) { + ChatManager.chatSystemInfo(sourcePlayer, "This would place your inventory over " + MBServerStatics.PLAYER_GOLD_LIMIT + " gold."); + return; } + + itemManager.addGoldToInventory(value, false); } private static void ackBankWindowOpened(AckBankWindowOpenedMsg msg, ClientConnection origin) {