summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/inventoryitem.h4
-rw-r--r--src/net/eathena/inventoryhandler.cpp28
-rw-r--r--src/net/eathena/tradehandler.cpp3
-rw-r--r--src/net/tmwa/inventoryhandler.cpp36
-rw-r--r--src/net/tmwa/tradehandler.cpp7
5 files changed, 52 insertions, 26 deletions
diff --git a/src/net/ea/inventoryitem.h b/src/net/ea/inventoryitem.h
index 5c0b86658..dcd90b336 100644
--- a/src/net/ea/inventoryitem.h
+++ b/src/net/ea/inventoryitem.h
@@ -50,7 +50,7 @@ class InventoryItem final
uint8_t refine;
unsigned char color;
Identified identified;
- bool damaged;
+ Damaged damaged;
bool favorite;
bool equip;
@@ -62,7 +62,7 @@ class InventoryItem final
const uint8_t refine0,
const unsigned char color0,
const Identified identified0,
- const bool damaged0,
+ const Damaged damaged0,
const bool favorite0,
const bool equip0) :
slot(slot0),
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 0c6ef7141..2be927bc9 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -384,7 +384,7 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
inventory->setItem(index, itemId, itemType, 1, refine,
1,
fromBool(flags.bits.isIdentified, Identified),
- flags.bits.isDamaged,
+ fromBool(flags.bits.isDamaged, Damaged),
flags.bits.isFavorite,
true, false);
inventory->setCards(index, cards, 4);
@@ -484,7 +484,8 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
inventory->setItem(index, itemId, itemType, amount, refine,
1,
fromBool(identified, Identified),
- damaged != 0, false,
+ fromBool(damaged, Damaged),
+ false,
equipType != 0, false);
inventory->setCards(index, cards, 4);
}
@@ -531,7 +532,7 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
inventory->setItem(index, itemId, itemType, amount,
0, 1,
fromBool(flags.bits.isIdentified, Identified),
- flags.bits.isDamaged,
+ fromBool(flags.bits.isDamaged, Damaged),
flags.bits.isFavorite,
false, false);
inventory->setCards(index, cards, 4);
@@ -567,7 +568,8 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
mInventoryItems.push_back(Ea::InventoryItem(index, itemId, itemType,
cards, amount, 0, 1,
fromBool(flags.bits.isIdentified, Identified),
- flags.bits.isDamaged, flags.bits.isFavorite, false));
+ fromBool(flags.bits.isDamaged, Damaged),
+ flags.bits.isFavorite, false));
}
BLOCK_END("InventoryHandler::processPlayerInventory")
}
@@ -666,7 +668,9 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
mInventoryItems.push_back(Ea::InventoryItem(index, itemId, itemType,
cards, amount, refine, 1,
fromBool(flags.bits.isIdentified, Identified),
- flags.bits.isDamaged, flags.bits.isFavorite, false));
+ fromBool(flags.bits.isDamaged, Damaged),
+ flags.bits.isFavorite,
+ false));
}
BLOCK_END("InventoryHandler::processPlayerStorageEquip")
}
@@ -698,7 +702,8 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
mStorage->setItem(index, itemId, itemType, amount,
refine, 1,
fromBool(identified, Identified),
- false, false, false, false);
+ Damaged_False,
+ false, false, false);
mStorage->setCards(index, cards, 4);
}
}
@@ -839,7 +844,8 @@ void InventoryHandler::processPlayerCartAdd(Net::MessageIn &msg)
inventory->setItem(index, itemId, itemType, amount, refine,
1,
fromBool(identified, Identified),
- false, false, false, false);
+ Damaged_False,
+ false, false, false);
inventory->setCards(index, cards, 4);
}
BLOCK_END("InventoryHandler::processPlayerCartAdd")
@@ -871,7 +877,9 @@ void InventoryHandler::processPlayerCartEquip(Net::MessageIn &msg)
mCartItems.push_back(Ea::InventoryItem(index, itemId, itemType,
cards, amount, refine, 1,
fromBool(flags.bits.isIdentified, Identified),
- flags.bits.isDamaged, flags.bits.isFavorite, false));
+ fromBool(flags.bits.isDamaged, Damaged),
+ flags.bits.isFavorite,
+ false));
}
BLOCK_END("InventoryHandler::processPlayerCartEquip")
}
@@ -901,7 +909,9 @@ void InventoryHandler::processPlayerCartItems(Net::MessageIn &msg)
mCartItems.push_back(Ea::InventoryItem(index, itemId, itemType,
cards, amount, 0, 1,
fromBool(flags.bits.isIdentified, Identified),
- flags.bits.isDamaged, flags.bits.isFavorite, false));
+ fromBool(flags.bits.isDamaged, Damaged),
+ flags.bits.isFavorite,
+ false));
}
BLOCK_END("InventoryHandler::processPlayerCartItems")
}
diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp
index 303ebd7c9..a1a5f261b 100644
--- a/src/net/eathena/tradehandler.cpp
+++ b/src/net/eathena/tradehandler.cpp
@@ -208,7 +208,8 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
false, amount,
refine, 1,
fromBool(identify, Identified),
- false, false, false);
+ Damaged_False,
+ false, false);
}
}
}
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index efaff9567..4319b84f2 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -299,14 +299,16 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
inventory->setItem(index, itemId, itemType, 1, refine,
identified,
Identified_True,
- false, false, true, false);
+ Damaged_False,
+ false, true, false);
}
else
{
inventory->setItem(index, itemId, itemType, 1, refine,
1,
fromBool(identified, Identified),
- false, false, true, false);
+ Damaged_False,
+ false, true, false);
}
inventory->setCards(index, cards, 4);
}
@@ -405,14 +407,16 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
inventory->setItem(index, itemId, type, amount, refine,
identified,
Identified_True,
- false, false, equipType != 0, false);
+ Damaged_False,
+ false, equipType != 0, false);
}
else
{
inventory->setItem(index, itemId, type, amount, refine,
1,
fromBool(identified, Identified),
- false, false, equipType != 0, false);
+ Damaged_False,
+ false, equipType != 0, false);
}
inventory->setCards(index, cards, 4);
}
@@ -470,14 +474,16 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
inventory->setItem(index, itemId, itemType, amount,
0, identified,
Identified_True,
- false, false, isEquipment, false);
+ Damaged_False,
+ false, isEquipment, false);
}
else
{
inventory->setItem(index, itemId, itemType, amount,
0, 1,
fromBool(identified, Identified),
- false, false, isEquipment, false);
+ Damaged_False,
+ false, isEquipment, false);
}
inventory->setCards(index, cards, 4);
}
@@ -518,14 +524,16 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
itemType, cards, amount, 0, identified,
Identified_True,
- false, false, false));
+ Damaged_False,
+ false, false));
}
else
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
itemType, cards, amount, 0, 1,
fromBool(identified, Identified),
- false, false, false));
+ Damaged_False,
+ false, false));
}
}
BLOCK_END("InventoryHandler::processPlayerInventory")
@@ -595,14 +603,16 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
itemType, cards, amount, refine, identified,
Identified_True,
- false, false, false));
+ Damaged_False,
+ false, false));
}
else
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
itemType, cards, amount, refine, 1,
fromBool(identified, Identified),
- false, false, false));
+ Damaged_False,
+ false, false));
}
}
BLOCK_END("InventoryHandler::processPlayerStorageEquip")
@@ -636,14 +646,16 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
mStorage->setItem(index, itemId, 0, amount,
refine, identified,
Identified_True,
- false, false, false, false);
+ Damaged_False,
+ false, false, false);
}
else
{
mStorage->setItem(index, itemId, 0, amount,
refine, 1,
fromBool(identified, Identified),
- false, false, false, false);
+ Damaged_False,
+ false, false, false);
}
mStorage->setCards(index, cards, 4);
}
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index 53336bb24..a00bd4952 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -196,7 +196,9 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
false, amount,
refine,
identify,
- Identified_True, false, false, false);
+ Identified_True,
+ Damaged_False,
+ false, false);
}
else
{
@@ -205,7 +207,8 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
false, amount,
refine, 1,
fromBool(identify, Identified),
- false, false, false);
+ Damaged_False,
+ false, false);
}
}
}