summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-01 18:53:25 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-01 18:53:25 +0300
commitd4e5a5064bec115a7fc204766d1bc0725b883407 (patch)
tree8e1cb62c2a936a95be679c68b38cb73704e05ed0 /src/net/eathena
parent7abf9198788c8ec476c6099faf7ebd25be372655 (diff)
downloadmv-d4e5a5064bec115a7fc204766d1bc0725b883407.tar.gz
mv-d4e5a5064bec115a7fc204766d1bc0725b883407.tar.bz2
mv-d4e5a5064bec115a7fc204766d1bc0725b883407.tar.xz
mv-d4e5a5064bec115a7fc204766d1bc0725b883407.zip
Fix cart inventory initialisation if was no items in cart inventory.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/inventoryrecv.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index 5cd362b14..044b4a9d3 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -748,7 +748,8 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg)
}
}
- if (inventory)
+ // check what cart was created, if not add delayed items
+ if (inventory && inventory->getSize() > 0)
{
const Item *const item = inventory->getItem(index);
@@ -768,6 +769,20 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg)
Equipped_false);
inventory->setCards(index, cards, 4);
}
+ else
+ {
+ mCartItems.push_back(Ea::InventoryItem(index,
+ itemId,
+ itemType,
+ cards,
+ amount,
+ refine,
+ ItemColorManager::getColorFromCards(&cards[0]),
+ fromBool(identified, Identified),
+ damaged,
+ Favorite_false,
+ Equipm_false));
+ }
BLOCK_END("InventoryRecv::processPlayerCartAdd")
}