forked from MagicBane/Server
junk from inventory
This commit is contained in:
@@ -566,6 +566,34 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
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);
|
||||||
|
|
||||||
|
itemManager.updateInventory();
|
||||||
|
|
||||||
|
//test
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ackBankWindowOpened(AckBankWindowOpenedMsg msg, ClientConnection origin) {
|
private static void ackBankWindowOpened(AckBankWindowOpenedMsg msg, ClientConnection origin) {
|
||||||
|
|||||||
@@ -970,33 +970,6 @@ public class CharacterItemManager {
|
|||||||
// if (i.getObjectType() != GameObjectType.MobLoot)
|
// if (i.getObjectType() != GameObjectType.MobLoot)
|
||||||
// CharacterItemManager.junkedItems.add(i);
|
// 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();
|
calculateWeights();
|
||||||
|
|
||||||
if (updateInventory)
|
if (updateInventory)
|
||||||
|
|||||||
Reference in New Issue
Block a user