summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-15 13:58:32 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-16 01:52:14 +0300
commit41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch)
tree22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/net/eathena/inventoryhandler.cpp
parent7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff)
downloadmanaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz
manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2
manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz
manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip
Add strong typed int for item color.
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r--src/net/eathena/inventoryhandler.cpp91
1 files changed, 70 insertions, 21 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 86faea2e7..c2b01be22 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -458,8 +458,12 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
flags.byte = msg.readUInt8("flags");
if (inventory)
{
- inventory->setItem(index, itemId, itemType, 1, refine,
+ inventory->setItem(index,
+ itemId,
+ itemType,
1,
+ refine,
+ ItemColor_one,
fromBool(flags.bits.isIdentified, Identified),
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
@@ -542,14 +546,23 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
break;
}
if (localPlayer)
- localPlayer->pickedUp(itemInfo, 0, 1, floorId, pickup);
+ {
+ localPlayer->pickedUp(itemInfo,
+ 0,
+ ItemColor_one,
+ floorId,
+ pickup);
+ }
}
else
{
if (localPlayer)
{
- localPlayer->pickedUp(itemInfo, amount,
- 1, floorId, Pickup::OKAY);
+ localPlayer->pickedUp(itemInfo,
+ amount,
+ ItemColor_one,
+ floorId,
+ Pickup::OKAY);
}
if (inventory)
@@ -559,8 +572,12 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += item->getQuantity();
- inventory->setItem(index, itemId, itemType, amount, refine,
- 1,
+ inventory->setItem(index,
+ itemId,
+ itemType,
+ amount,
+ refine,
+ ItemColor_one,
fromBool(identified, Identified),
fromBool(damaged, Damaged),
Favorite_false,
@@ -608,8 +625,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(flags.bits.isIdentified, Identified),
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
@@ -645,8 +666,13 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
ItemFlags flags;
flags.byte = msg.readUInt8("flags");
- 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(flags.bits.isIdentified, Identified),
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
@@ -746,8 +772,13 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
ItemFlags flags;
flags.byte = msg.readUInt8("flags");
- 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(flags.bits.isIdentified, Identified),
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
@@ -773,15 +804,19 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
if (Item *const item = mStorage->getItem(index))
{
- item->setId(itemId, 1);
+ item->setId(itemId, ItemColor_one);
item->increaseQuantity(amount);
}
else
{
if (mStorage)
{
- mStorage->setItem(index, itemId, itemType, amount,
- refine, 1,
+ mStorage->setItem(index,
+ itemId,
+ itemType,
+ amount,
+ refine,
+ ItemColor_one,
fromBool(identified, Identified),
Damaged_false,
Favorite_false,
@@ -960,8 +995,12 @@ void InventoryHandler::processPlayerCartAdd(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += item->getQuantity();
- inventory->setItem(index, itemId, itemType, amount, refine,
- 1,
+ inventory->setItem(index,
+ itemId,
+ itemType,
+ amount,
+ refine,
+ ItemColor_one,
fromBool(identified, Identified),
Damaged_false,
Favorite_false,
@@ -995,8 +1034,13 @@ void InventoryHandler::processPlayerCartEquip(Net::MessageIn &msg)
ItemFlags flags;
flags.byte = msg.readUInt8("flags");
- mCartItems.push_back(Ea::InventoryItem(index, itemId, itemType,
- cards, amount, refine, 1,
+ mCartItems.push_back(Ea::InventoryItem(index,
+ itemId,
+ itemType,
+ cards,
+ amount,
+ refine,
+ ItemColor_one,
fromBool(flags.bits.isIdentified, Identified),
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
@@ -1027,8 +1071,13 @@ void InventoryHandler::processPlayerCartItems(Net::MessageIn &msg)
ItemFlags flags;
flags.byte = msg.readUInt8("flags");
- mCartItems.push_back(Ea::InventoryItem(index, itemId, itemType,
- cards, amount, 0, 1,
+ mCartItems.push_back(Ea::InventoryItem(index,
+ itemId,
+ itemType,
+ cards,
+ amount,
+ 0,
+ ItemColor_one,
fromBool(flags.bits.isIdentified, Identified),
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),