|
|
@ -103,7 +103,7 @@ public class CharacterItemManager { |
|
|
|
return; |
|
|
|
return; |
|
|
|
if (take != null) { |
|
|
|
if (take != null) { |
|
|
|
itemMan.buyFromNPC(take, npc); |
|
|
|
itemMan.buyFromNPC(take, npc); |
|
|
|
itemMan.updateInventory(); |
|
|
|
itemMan.StackResources(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -690,7 +690,7 @@ public class CharacterItemManager { |
|
|
|
this.addGoldToTrade(amt); |
|
|
|
this.addGoldToTrade(amt); |
|
|
|
|
|
|
|
|
|
|
|
// BONUS CODE BELOW: Thanks some unknown retard!
|
|
|
|
// BONUS CODE BELOW: Thanks some unknown retard!
|
|
|
|
// sourceItemMan.updateInventory(sourceItemMan.getInventory(), true);
|
|
|
|
// sourceItemMan.StackResources(sourceItemMan.getInventory(), true);
|
|
|
|
|
|
|
|
|
|
|
|
UpdateGoldMsg ugm = new UpdateGoldMsg(source); |
|
|
|
UpdateGoldMsg ugm = new UpdateGoldMsg(source); |
|
|
|
ugm.configure(); |
|
|
|
ugm.configure(); |
|
|
@ -936,13 +936,13 @@ public class CharacterItemManager { |
|
|
|
return junk(i, true); |
|
|
|
return junk(i, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private synchronized boolean junk(Item i, boolean updateInventory) { |
|
|
|
private synchronized boolean junk(Item i, boolean StackResources) { |
|
|
|
if (i.getItemBase().getType().equals(ItemType.GOLD)) { |
|
|
|
if (i.getItemBase().getType().equals(ItemType.GOLD)) { |
|
|
|
if (this.getGoldInventory().getObjectUUID() == i.getObjectUUID()) |
|
|
|
if (this.getGoldInventory().getObjectUUID() == i.getObjectUUID()) |
|
|
|
if (DbManager.ItemQueries.UPDATE_GOLD(i, 0)) { |
|
|
|
if (DbManager.ItemQueries.UPDATE_GOLD(i, 0)) { |
|
|
|
this.getGoldInventory().setNumOfItems(0); |
|
|
|
this.getGoldInventory().setNumOfItems(0); |
|
|
|
if (updateInventory) |
|
|
|
if (StackResources) |
|
|
|
updateInventory(); |
|
|
|
StackResources(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -970,9 +970,9 @@ public class CharacterItemManager { |
|
|
|
|
|
|
|
|
|
|
|
calculateWeights(); |
|
|
|
calculateWeights(); |
|
|
|
|
|
|
|
|
|
|
|
if (updateInventory) |
|
|
|
if (StackResources) |
|
|
|
// Send the new inventory
|
|
|
|
// Send the new inventory
|
|
|
|
//updateInventory(i, false); this line was causing entire inventory to disappear
|
|
|
|
//StackResources(i, false); this line was causing entire inventory to disappear
|
|
|
|
updateInventory(this.getInventory(), true); |
|
|
|
updateInventory(this.getInventory(), true); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -1247,7 +1247,7 @@ public class CharacterItemManager { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
int amt = i.getNumOfItems(); |
|
|
|
int amt = i.getNumOfItems(); |
|
|
|
if (DbManager.ItemQueries.UPDATE_GOLD(this.goldInventory, this.goldInventory.getNumOfItems() + amt)) { |
|
|
|
if (DbManager.ItemQueries.UPDATE_GOLD(this.goldInventory, this.goldInventory.getNumOfItems() + amt)) { |
|
|
|
updateInventory(); |
|
|
|
StackResources(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -1475,7 +1475,7 @@ public class CharacterItemManager { |
|
|
|
|
|
|
|
|
|
|
|
if (sdrMerchant) { |
|
|
|
if (sdrMerchant) { |
|
|
|
this.delete(itemToSell); |
|
|
|
this.delete(itemToSell); |
|
|
|
this.updateInventory(); |
|
|
|
this.StackResources(); |
|
|
|
|
|
|
|
|
|
|
|
} else if (!itemToSell.moveItemToInventory(npc)) |
|
|
|
} else if (!itemToSell.moveItemToInventory(npc)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -2276,8 +2276,8 @@ public class CharacterItemManager { |
|
|
|
return; |
|
|
|
return; |
|
|
|
PlayerCharacter pc = (PlayerCharacter) this.absCharacter; |
|
|
|
PlayerCharacter pc = (PlayerCharacter) this.absCharacter; |
|
|
|
|
|
|
|
|
|
|
|
UpdateInventoryMsg updateInventoryMsg = new UpdateInventoryMsg(inventory, this.getBank(), this.getGoldInventory(), add); |
|
|
|
UpdateInventoryMsg StackResourcesMsg = new UpdateInventoryMsg(inventory, this.getBank(), this.getGoldInventory(), add); |
|
|
|
Dispatch dispatch = Dispatch.borrow(pc, updateInventoryMsg); |
|
|
|
Dispatch dispatch = Dispatch.borrow(pc, StackResourcesMsg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|