forked from MagicBane/Server
junk from inventory
This commit is contained in:
@@ -566,32 +566,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
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;
|
||||
|
||||
int value = ib.getBaseValue();
|
||||
|
||||
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);
|
||||
|
||||
//test
|
||||
}
|
||||
|
||||
private static void ackBankWindowOpened(AckBankWindowOpenedMsg msg, ClientConnection origin) {
|
||||
|
||||
@@ -971,6 +971,32 @@ public class CharacterItemManager {
|
||||
// CharacterItemManager.junkedItems.add(i);
|
||||
|
||||
|
||||
ItemBase ib = i.getItemBase();
|
||||
|
||||
if(ib == null)
|
||||
return false;
|
||||
|
||||
if(ib.getUUID() == 7) // don't allow gold to junk for gold
|
||||
return false;
|
||||
|
||||
int value = ib.getBaseValue();
|
||||
|
||||
Item gold = this.absCharacter.charItemManager.getGoldInventory();
|
||||
int curAmt;
|
||||
if (gold == null)
|
||||
curAmt = 0;
|
||||
else
|
||||
curAmt = gold.getNumOfItems();
|
||||
|
||||
if ((curAmt + value) > MBServerStatics.PLAYER_GOLD_LIMIT) {
|
||||
ChatManager.chatSystemInfo((PlayerCharacter)this.absCharacter, "This would place your inventory over " + MBServerStatics.PLAYER_GOLD_LIMIT + " gold.");
|
||||
return false;
|
||||
}
|
||||
|
||||
this.absCharacter.charItemManager.addGoldToInventory(value, false);
|
||||
|
||||
//test
|
||||
|
||||
calculateWeights();
|
||||
|
||||
if (updateInventory)
|
||||
|
||||
Reference in New Issue
Block a user