summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-23 20:53:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-23 20:53:16 +0300
commit3fb968387deba0cbfd59d029aa6cf4789d68d09c (patch)
tree46eb904ec8efd5a0e7e9c69c005a383a51e50f85 /src/net/tmwa/inventoryrecv.cpp
parent2b81fecc1c7c239e4b35312f46952e9b16029b67 (diff)
downloadmv-3fb968387deba0cbfd59d029aa6cf4789d68d09c.tar.gz
mv-3fb968387deba0cbfd59d029aa6cf4789d68d09c.tar.bz2
mv-3fb968387deba0cbfd59d029aa6cf4789d68d09c.tar.xz
mv-3fb968387deba0cbfd59d029aa6cf4789d68d09c.zip
Dont show asserts in pickup special packets.
Diffstat (limited to 'src/net/tmwa/inventoryrecv.cpp')
-rw-r--r--src/net/tmwa/inventoryrecv.cpp43
1 files changed, 32 insertions, 11 deletions
diff --git a/src/net/tmwa/inventoryrecv.cpp b/src/net/tmwa/inventoryrecv.cpp
index 878a03538..9d753efe2 100644
--- a/src/net/tmwa/inventoryrecv.cpp
+++ b/src/net/tmwa/inventoryrecv.cpp
@@ -159,7 +159,6 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
cards[f] = msg.readUInt16("card");
const int equipType = msg.readInt16("equip type");
const ItemTypeT type = static_cast<ItemTypeT>(msg.readUInt8("item type"));
- const ItemInfo &itemInfo = ItemDB::get(itemId);
const unsigned char err = msg.readUInt8("status");
BeingId floorId;
if (Ea::InventoryRecv::mSentPickups.empty())
@@ -202,22 +201,44 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
}
if (localPlayer)
{
- localPlayer->pickedUp(itemInfo,
- 0,
- ItemColor_one,
- floorId,
- pickup);
+ if (itemId == 0)
+ {
+ localPlayer->pickedUp(ItemDB::getEmpty(),
+ 0,
+ ItemColor_one,
+ floorId,
+ pickup);
+ }
+ else
+ {
+ localPlayer->pickedUp(ItemDB::get(itemId),
+ 0,
+ ItemColor_one,
+ floorId,
+ pickup);
+ }
}
}
else
{
if (localPlayer)
{
- localPlayer->pickedUp(itemInfo,
- amount,
- ItemColor_one,
- floorId,
- Pickup::OKAY);
+ if (itemId == 0)
+ {
+ localPlayer->pickedUp(ItemDB::getEmpty(),
+ amount,
+ ItemColor_one,
+ floorId,
+ Pickup::OKAY);
+ }
+ else
+ {
+ localPlayer->pickedUp(ItemDB::get(itemId),
+ amount,
+ ItemColor_one,
+ floorId,
+ Pickup::OKAY);
+ }
}
if (inventory)