diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/game-server/inventory.cpp | 9 |
2 files changed, 7 insertions, 4 deletions
@@ -10,6 +10,8 @@ * src/game-server/inventory.hpp, src/game-server/inventory.cpp, src/game-server/buysell.cpp: Added money accessor to the inventory manager. + * src/game-server/inventory.cpp: Fixed incorrect update message when + merging item stacks and removing one of them. 2007-08-13 Eugenio Favalli <elvenprogrammer@gmail.com> diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp index 767ed72e..4111e07e 100644 --- a/src/game-server/inventory.cpp +++ b/src/game-server/inventory.cpp @@ -324,6 +324,7 @@ bool Inventory::changeMoney(int amount) mPoss->money = money; msg.writeByte(255); msg.writeLong(money); + return true; } void Inventory::freeIndex(int i) @@ -438,6 +439,10 @@ int Inventory::move(int slot1, int slot2, int amount) it2.amount += nb; amount -= nb; + msg.writeByte(slot2 + EQUIP_CLIENT_INVENTORY); + msg.writeShort(it2.itemId); + msg.writeByte(it2.amount); + msg.writeByte(slot1 + EQUIP_CLIENT_INVENTORY); if (it1.amount == 0) { @@ -449,10 +454,6 @@ int Inventory::move(int slot1, int slot2, int amount) msg.writeShort(it1.itemId); msg.writeByte(it1.amount); } - - msg.writeByte(slot2 + EQUIP_CLIENT_INVENTORY); - msg.writeShort(it2.itemId); - msg.writeByte(it2.amount); return amount; } |