diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-15 13:58:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 01:52:14 +0300 |
commit | 41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch) | |
tree | 22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/net/tmwa/inventoryhandler.cpp | |
parent | 7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff) | |
download | manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2 manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz manaverse-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip |
Add strong typed int for item color.
Diffstat (limited to 'src/net/tmwa/inventoryhandler.cpp')
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 65 |
1 files changed, 50 insertions, 15 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 5ff9325ae..05ed6e40d 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -292,8 +292,12 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) if (inventory) { - inventory->setItem(index, itemId, itemType, 1, refine, + inventory->setItem(index, + itemId, + itemType, 1, + refine, + ItemColor_one, fromBool(identified, Identified), Damaged_false, Favorite_false, @@ -374,14 +378,23 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) break; } if (localPlayer) - localPlayer->pickedUp(itemInfo, 0, identified, floorId, pickup); + { + localPlayer->pickedUp(itemInfo, + 0, + fromInt(identified, ItemColor), + floorId, + pickup); + } } else { if (localPlayer) { - localPlayer->pickedUp(itemInfo, amount, - identified, floorId, Pickup::OKAY); + localPlayer->pickedUp(itemInfo, + amount, + fromInt(identified, ItemColor), + floorId, + Pickup::OKAY); } if (inventory) @@ -391,8 +404,12 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) if (item && item->getId() == itemId) amount += item->getQuantity(); - inventory->setItem(index, itemId, type, amount, refine, - 1, + inventory->setItem(index, + itemId, + type, + amount, + refine, + ItemColor_one, fromBool(identified, Identified), Damaged_false, Favorite_false, @@ -449,8 +466,12 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg) if (inventory) { - inventory->setItem(index, itemId, itemType, amount, - 0, 1, + inventory->setItem(index, + itemId, + itemType, + amount, + 0, + ItemColor_one, fromBool(identified, Identified), Damaged_false, Favorite_false, @@ -490,8 +511,13 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg) cards[0], cards[1], cards[2], cards[3]); } - mInventoryItems.push_back(Ea::InventoryItem(index, itemId, - itemType, cards, amount, 0, 1, + mInventoryItems.push_back(Ea::InventoryItem(index, + itemId, + itemType, + cards, + amount, + 0, + ItemColor_one, fromBool(identified, Identified), Damaged_false, Favorite_false, @@ -559,8 +585,13 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg) static_cast<unsigned int>(refine)); } - mInventoryItems.push_back(Ea::InventoryItem(index, itemId, - itemType, cards, amount, refine, 1, + mInventoryItems.push_back(Ea::InventoryItem(index, + itemId, + itemType, + cards, + amount, + refine, + ItemColor_one, fromBool(identified, Identified), Damaged_false, Favorite_false, @@ -585,15 +616,19 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg) if (Item *const item = mStorage->getItem(index)) { - item->setId(itemId, identified); + item->setId(itemId, ItemColor_one); item->increaseQuantity(amount); } else { if (mStorage) { - mStorage->setItem(index, itemId, 0, amount, - refine, 1, + mStorage->setItem(index, + itemId, + 0, + amount, + refine, + ItemColor_one, fromBool(identified, Identified), Damaged_false, Favorite_false, |