diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-14 21:41:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-14 21:41:38 +0300 |
commit | 1884c7ebfce2f9a2723da41be09cde5e7e14938e (patch) | |
tree | bd0ca87ffdacdb97af37eaf2fcdd835f7ebe877e /src/net/tmwa/inventoryhandler.cpp | |
parent | 91a0b8f7e497be66225e0e24679bb515daefe7cf (diff) | |
download | mv-1884c7ebfce2f9a2723da41be09cde5e7e14938e.tar.gz mv-1884c7ebfce2f9a2723da41be09cde5e7e14938e.tar.bz2 mv-1884c7ebfce2f9a2723da41be09cde5e7e14938e.tar.xz mv-1884c7ebfce2f9a2723da41be09cde5e7e14938e.zip |
Stop protected pickups flood.
Diffstat (limited to 'src/net/tmwa/inventoryhandler.cpp')
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index e5ccc9110..dcbc06e07 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -159,6 +159,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) int number, flag; int index, amount, itemId, equipType, arrow, refine; int cards[4], itemType; + int floorId; unsigned char identified; Inventory *inventory = 0; if (player_node) @@ -289,17 +290,30 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) const ItemInfo &itemInfo = ItemDB::get(itemId); unsigned char err = msg.readInt8(); + if (mSentPickups.empty()) + { + floorId = 0; + } + else + { + floorId = mSentPickups.front(); + mSentPickups.pop(); + } + if (err) { if (player_node) - player_node->pickedUp(itemInfo, 0, identified, err); + { + player_node->pickedUp(itemInfo, 0, identified, + floorId, err); + } } else { if (player_node) { player_node->pickedUp(itemInfo, amount, - identified, PICKUP_OKAY); + identified, floorId, PICKUP_OKAY); } if (inventory) |