diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-01 18:53:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-01 18:53:25 +0300 |
commit | d4e5a5064bec115a7fc204766d1bc0725b883407 (patch) | |
tree | 8e1cb62c2a936a95be679c68b38cb73704e05ed0 /src | |
parent | 7abf9198788c8ec476c6099faf7ebd25be372655 (diff) | |
download | manaverse-d4e5a5064bec115a7fc204766d1bc0725b883407.tar.gz manaverse-d4e5a5064bec115a7fc204766d1bc0725b883407.tar.bz2 manaverse-d4e5a5064bec115a7fc204766d1bc0725b883407.tar.xz manaverse-d4e5a5064bec115a7fc204766d1bc0725b883407.zip |
Fix cart inventory initialisation if was no items in cart inventory.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 17 |
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") } |