summaryrefslogtreecommitdiff
path: root/src/net/eathena
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
parent7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff)
downloadmanaverse-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/eathena')
-rw-r--r--src/net/eathena/beinghandler.cpp50
-rw-r--r--src/net/eathena/buyingstorehandler.cpp4
-rw-r--r--src/net/eathena/buysellhandler.cpp2
-rw-r--r--src/net/eathena/cashshophandler.cpp4
-rw-r--r--src/net/eathena/cashshophandler.h2
-rw-r--r--src/net/eathena/charserverhandler.cpp6
-rw-r--r--src/net/eathena/inventoryhandler.cpp91
-rw-r--r--src/net/eathena/itemhandler.cpp10
-rw-r--r--src/net/eathena/markethandler.cpp4
-rw-r--r--src/net/eathena/markethandler.h2
-rw-r--r--src/net/eathena/npchandler.cpp2
-rw-r--r--src/net/eathena/npchandler.h2
-rw-r--r--src/net/eathena/tradehandler.cpp12
-rw-r--r--src/net/eathena/vendinghandler.cpp2
14 files changed, 126 insertions, 67 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 35d549149..5c748915b 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -585,100 +585,101 @@ void BeingHandler::processBeingChangeLookContinue(Net::MessageIn &msg,
dstBeing->getLook());
break;
case 1: // eAthena LOOK_HAIR
- dstBeing->setHairColor(id);
+ dstBeing->setHairColor(fromInt(id, ItemColor));
dstBeing->setSpriteID(SPRITE_HAIR_COLOR, id * -1);
break;
case 2: // LOOK_WEAPON Weapon ID in id, Shield ID in id2
- dstBeing->setSprite(SPRITE_BODY, id, "", 1, true);
+ dstBeing->setSprite(SPRITE_BODY, id, "", ItemColor_one, true);
dstBeing->setSprite(SPRITE_FLOOR, id2);
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR);
break;
case 3: // LOOK_HEAD_BOTTOM
dstBeing->setSprite(SPRITE_WEAPON, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_WEAPON);
break;
case 4: // LOOK_HEAD_TOP Change upper headgear for eAthena, hat for us
dstBeing->setSprite(SPRITE_CLOTHES_COLOR, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_CLOTHES_COLOR);
break;
case 5: // LOOK_HEAD_MID Change middle headgear for eathena,
// armor for us
dstBeing->setSprite(SPRITE_HEAD_BOTTOM, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_BOTTOM);
break;
case 6: // eAthena LOOK_HAIR_COLOR
- dstBeing->setHairColor(id);
+ dstBeing->setHairColor(fromInt(id, ItemColor));
dstBeing->setSpriteColor(SPRITE_HAIR_COLOR,
ItemDB::get(dstBeing->getSpriteID(
- SPRITE_HAIR_COLOR)).getDyeColorsString(id));
+ SPRITE_HAIR_COLOR)).getDyeColorsString(
+ fromInt(id, ItemColor)));
break;
case 7: // Clothes color. Now used as look
dstBeing->setLook(static_cast<uint8_t>(id));
break;
case 8: // eAthena LOOK_SHIELD
dstBeing->setSprite(SPRITE_FLOOR, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_FLOOR);
break;
case 9: // eAthena LOOK_SHOES
dstBeing->setSprite(SPRITE_HAIR, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_HAIR);
break;
case 10: // LOOK_GLOVES
dstBeing->setSprite(SPRITE_SHOES, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_SHOES);
break;
case 11: // LOOK_FLOOR
dstBeing->setSprite(SPRITE_SHIELD, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD);
break;
case 12: // LOOK_ROBE
dstBeing->setSprite(SPRITE_HEAD_TOP, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_TOP);
break;
case 13: // COSTUME_HEAD_TOP
dstBeing->setSprite(SPRITE_HEAD_MID, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_HEAD_MID);
break;
case 14: // COSTUME_HEAD_MID
dstBeing->setSprite(SPRITE_ROBE, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_ROBE);
break;
case 15: // COSTUME_HEAD_LOW
dstBeing->setSprite(SPRITE_EVOL2, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2);
break;
case 16: // COSTUME_GARMENT
dstBeing->setSprite(SPRITE_EVOL3, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL3);
break;
case 17: // ARMOR
dstBeing->setSprite(SPRITE_EVOL4, id, color,
- static_cast<unsigned char>(id2));
+ fromInt(id2, ItemColor));
if (localPlayer)
localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL4);
break;
@@ -769,7 +770,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
const uint16_t headTop = msg.readInt16("head top");
const uint16_t headMid = msg.readInt16("head mid");
- const int hairColor = msg.readInt16("hair color");
+ const ItemColor hairColor = fromInt(msg.readInt16("hair color"), ItemColor);
const uint16_t shoes = msg.readInt16("shoes or clothes color?");
const uint16_t gloves = msg.readInt16("head dir / gloves");
@@ -795,7 +796,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
setSprite(dstBeing, SPRITE_HAIR, shoes);
setSprite(dstBeing, SPRITE_SHOES, gloves);
- setSprite(dstBeing, SPRITE_BODY, weapon, "", 1, true);
+ setSprite(dstBeing, SPRITE_BODY, weapon, "", ItemColor_one, true);
// setSprite(dstBeing, SPRITE_FLOOR, shield);
}
else if (dstBeing->getType() == ActorType::Npc
@@ -930,7 +931,8 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
const uint16_t headTop = msg.readInt16("head top");
const uint16_t headMid = msg.readInt16("head mid");
- const int hairColor = msg.readInt16("hair color");
+ const ItemColor hairColor = fromInt(
+ msg.readInt16("hair color"), ItemColor);
const uint16_t shoes = msg.readInt16("shoes or clothes color?");
const uint16_t gloves = msg.readInt16("head dir / gloves");
@@ -958,7 +960,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
setSprite(dstBeing, SPRITE_HAIR, shoes);
setSprite(dstBeing, SPRITE_SHOES, gloves);
- setSprite(dstBeing, SPRITE_BODY, weapon, "", 1, true);
+ setSprite(dstBeing, SPRITE_BODY, weapon, "", ItemColor_one, true);
}
// setSprite(dstBeing, SPRITE_FLOOR, shield);
}
@@ -1097,9 +1099,9 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg)
const uint16_t headTop = msg.readInt16("head top");
const uint16_t headMid = msg.readInt16("head mid");
- const int hairColor = msg.readInt16("hair color");
+ const ItemColor hairColor = fromInt(
+ msg.readInt16("hair color"), ItemColor);
const uint16_t shoes = msg.readInt16("shoes or clothes color?");
-
const uint16_t gloves = msg.readInt16("head dir / gloves");
// may be use robe as gloves?
msg.readInt16("robe");
@@ -1123,7 +1125,7 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg)
setSprite(dstBeing, SPRITE_CLOTHES_COLOR, headTop);
setSprite(dstBeing, SPRITE_HAIR, shoes);
setSprite(dstBeing, SPRITE_SHOES, gloves);
- setSprite(dstBeing, SPRITE_BODY, weapon, "", 1, true);
+ setSprite(dstBeing, SPRITE_BODY, weapon, "", ItemColor_one, true);
// setSprite(dstBeing, SPRITE_FLOOR, shield);
}
else if (dstBeing->getType() == ActorType::Npc
diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp
index d42d66b07..4fcad8637 100644
--- a/src/net/eathena/buyingstorehandler.cpp
+++ b/src/net/eathena/buyingstorehandler.cpp
@@ -210,11 +210,11 @@ void BuyingStoreHandler::processBuyingStoreItemsList(Net::MessageIn &msg)
if (!inv)
continue;
- const Item *const item = inv->findItem(itemId, 1);
+ const Item *const item = inv->findItem(itemId, ItemColor_one);
if (!item)
continue;
// +++ need add colors support
- dialog->addItem(itemId, itemType, 1, amount, price);
+ dialog->addItem(itemId, itemType, ItemColor_one, amount, price);
}
}
diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp
index da64491ed..6e145a171 100644
--- a/src/net/eathena/buysellhandler.cpp
+++ b/src/net/eathena/buysellhandler.cpp
@@ -103,7 +103,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
msg.readInt32("dc value?");
const int type = msg.readUInt8("type");
const int itemId = msg.readInt16("item id");
- const unsigned char color = 1;
+ const ItemColor color = ItemColor_one;
mBuyDialog->addItem(itemId, type, color, 0, value);
}
mBuyDialog->sort();
diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp
index 23d6ab66d..012923424 100644
--- a/src/net/eathena/cashshophandler.cpp
+++ b/src/net/eathena/cashshophandler.cpp
@@ -104,7 +104,7 @@ void CashShopHandler::processCashShopOpen(Net::MessageIn &msg)
const int value = msg.readInt32("discount price");
const int type = msg.readUInt8("item type");
const int itemId = msg.readInt16("item id");
- const int color = 1;
+ const ItemColor color = ItemColor_one;
mBuyDialog->addItem(itemId, type, color, 0, value);
}
mBuyDialog->sort();
@@ -168,7 +168,7 @@ void CashShopHandler::processCashShopSchedule(Net::MessageIn &msg)
void CashShopHandler::buyItem(const int points,
const int itemId,
- const unsigned char color A_UNUSED,
+ const ItemColor color A_UNUSED,
const int amount) const
{
createOutPacket(CMSG_NPC_CASH_SHOP_BUY);
diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h
index cc8859a89..851b62527 100644
--- a/src/net/eathena/cashshophandler.h
+++ b/src/net/eathena/cashshophandler.h
@@ -43,7 +43,7 @@ class CashShopHandler final : public MessageHandler,
void buyItem(const int points,
const int itemId,
- const unsigned char color,
+ const ItemColor color,
const int amount) const override final;
void close() const override final;
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index b2310b029..960acf44d 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -235,7 +235,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
const int option A_UNUSED = (msg.readInt16("weapon") | 1) ^ 1;
const int weapon = 0;
- tempPlayer->setSprite(SPRITE_BODY, weapon, "", 1, true);
+ tempPlayer->setSprite(SPRITE_BODY, weapon, "", ItemColor_one, true);
data.mAttributes[Attributes::LEVEL] = msg.readInt16("level");
@@ -245,8 +245,8 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
const int hat = msg.readInt16("head top");
const int topClothes = msg.readInt16("head mid");
- const uint16_t color = msg.readInt16("hair color");
- tempPlayer->setHairColor(static_cast<unsigned char>(color));
+ const ItemColor color = fromInt(msg.readInt16("hair color"), ItemColor);
+ tempPlayer->setHairColor(color);
tempPlayer->setSprite(SPRITE_HAIR_COLOR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(
color));
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),
diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp
index ce5dfadfb..4fa4a7e3e 100644
--- a/src/net/eathena/itemhandler.cpp
+++ b/src/net/eathena/itemhandler.cpp
@@ -82,7 +82,7 @@ void ItemHandler::processItemDropped(Net::MessageIn &msg)
const BeingId id = msg.readBeingId("id");
const int itemId = msg.readInt16("item id");
msg.readInt16("type");
- const uint8_t identify = msg.readUInt8("identify");
+ msg.readUInt8("identify");
const int x = msg.readInt16("x");
const int y = msg.readInt16("y");
const int subX = static_cast<int>(msg.readInt8("subx"));
@@ -91,8 +91,12 @@ void ItemHandler::processItemDropped(Net::MessageIn &msg)
if (actorManager)
{
- actorManager->createItem(id, itemId,
- x, y, amount, identify, subX, subY);
+ actorManager->createItem(id,
+ itemId,
+ x, y,
+ amount,
+ ItemColor_one,
+ subX, subY);
}
}
diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp
index 265fc7ca5..d0e8ff6ce 100644
--- a/src/net/eathena/markethandler.cpp
+++ b/src/net/eathena/markethandler.cpp
@@ -87,7 +87,7 @@ void MarketHandler::processMarketOpen(Net::MessageIn &msg)
const int value = msg.readInt32("price");
const int amount = msg.readInt32("amount");
msg.readInt16("view");
- const unsigned char color = 1;
+ const ItemColor color = ItemColor_one;
mBuyDialog->addItem(itemId, type, color, amount, value);
}
mBuyDialog->sort();
@@ -116,7 +116,7 @@ void MarketHandler::close()
void MarketHandler::buyItem(const int itemId,
const int type,
- const unsigned char color A_UNUSED,
+ const ItemColor color A_UNUSED,
const int amount) const
{
const bool nonStack = type == 4 || type == 5 || type == 7 || type == 8;
diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h
index 42a4bcac0..e58ac1e68 100644
--- a/src/net/eathena/markethandler.h
+++ b/src/net/eathena/markethandler.h
@@ -43,7 +43,7 @@ class MarketHandler final : public MessageHandler,
void buyItem(const int itemId,
const int type,
- const unsigned char color,
+ const ItemColor color,
const int amount) const override final;
protected:
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index e8a7daf8b..7b376fbeb 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -212,7 +212,7 @@ void NpcHandler::sell(const BeingId beingId) const
void NpcHandler::buyItem(const BeingId beingId A_UNUSED,
const int itemId,
- const unsigned char color A_UNUSED,
+ const ItemColor color A_UNUSED,
const int amount) const
{
createOutPacket(CMSG_NPC_BUY_REQUEST);
diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h
index 75d9a245d..3b35cadc5 100644
--- a/src/net/eathena/npchandler.h
+++ b/src/net/eathena/npchandler.h
@@ -60,7 +60,7 @@ class NpcHandler final : public MessageHandler, public Ea::NpcHandler
void buyItem(const BeingId beingId,
const int itemId,
- const unsigned char color,
+ const ItemColor color,
const int amount) const override final;
void sellItem(const BeingId beingId,
diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp
index 749d9343e..a76a08130 100644
--- a/src/net/eathena/tradehandler.cpp
+++ b/src/net/eathena/tradehandler.cpp
@@ -199,10 +199,14 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
}
else
{
- tradeWindow->addItem2(type, itemType,
- cards, 4,
- false, amount,
- refine, 1,
+ tradeWindow->addItem2(type,
+ itemType,
+ cards,
+ 4,
+ false,
+ amount,
+ refine,
+ ItemColor_one,
fromBool(identify, Identified),
Damaged_false,
Favorite_false,
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp
index 48b301a77..584aa1f23 100644
--- a/src/net/eathena/vendinghandler.cpp
+++ b/src/net/eathena/vendinghandler.cpp
@@ -158,7 +158,7 @@ void VendingHandler::processItemsList(Net::MessageIn &msg)
for (int d = 0; d < 4; d ++)
msg.readInt16("card");
- const unsigned char color = 1;
+ const ItemColor color = ItemColor_one;
ShopItem *const item = mBuyDialog->addItem(itemId, type,
color, amount, value);
if (item)