summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-10 23:26:53 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-10 23:26:53 +0300
commitb81f22b9ca68675d16fa2263b89d7dd0d179ef45 (patch)
tree7a4554927636a77d5233ceffc1814eee1fdd3578
parentf3f7879c48fe8e202c3519cd465225645949167e (diff)
downloadmv-b81f22b9ca68675d16fa2263b89d7dd0d179ef45.tar.gz
mv-b81f22b9ca68675d16fa2263b89d7dd0d179ef45.tar.bz2
mv-b81f22b9ca68675d16fa2263b89d7dd0d179ef45.tar.xz
mv-b81f22b9ca68675d16fa2263b89d7dd0d179ef45.zip
Add typed bool type Damaged.
-rw-r--r--src/beingequipbackend.cpp3
-rw-r--r--src/enums/simpletypes.h1
-rw-r--r--src/gui/windows/itemamountwindow.cpp3
-rw-r--r--src/gui/windows/tradewindow.cpp4
-rw-r--r--src/gui/windows/tradewindow.h4
-rw-r--r--src/inventory.cpp4
-rw-r--r--src/inventory.h4
-rw-r--r--src/item.cpp2
-rw-r--r--src/item.h8
-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
-rw-r--r--src/shopitem.cpp6
15 files changed, 74 insertions, 43 deletions
diff --git a/src/beingequipbackend.cpp b/src/beingequipbackend.cpp
index 2c5402970..c751dddc0 100644
--- a/src/beingequipbackend.cpp
+++ b/src/beingequipbackend.cpp
@@ -45,7 +45,8 @@ BeingEquipBackend::BeingEquipBackend(Being *const being)
mEquipment[idx] = new Item(id, 0, 1, 0,
being->mSpriteColorsIds[f],
Identified_True,
- false, false, true, true);
+ Damaged_False,
+ false, true, true);
}
}
}
diff --git a/src/enums/simpletypes.h b/src/enums/simpletypes.h
index 1b930b13c..11b5b9a42 100644
--- a/src/enums/simpletypes.h
+++ b/src/enums/simpletypes.h
@@ -48,5 +48,6 @@
#endif // ADVGCC
defBoolEnum(Identified);
+defBoolEnum(Damaged);
#endif // ENUMS_SIMPLETYPES_H
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 27c72a683..b144140d2 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -336,7 +336,8 @@ void ItemAmountWindow::action(const ActionEvent &event)
mItem = new Item(id, 0, 10000, 0, 1,
Identified_True,
- false, false, false, false);
+ Damaged_True,
+ false, false, false);
if (mUsage == ShopBuyAdd)
mMax = 10000;
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index b94584f4f..042c11b74 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -201,7 +201,7 @@ void TradeWindow::addItem(const int id,
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite) const
{
Inventory *inv = own ? mMyInventory : mPartnerInventory;
@@ -218,7 +218,7 @@ void TradeWindow::addItem2(const int id,
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment) const
{
diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h
index f48002deb..153fb0259 100644
--- a/src/gui/windows/tradewindow.h
+++ b/src/gui/windows/tradewindow.h
@@ -76,7 +76,7 @@ class TradeWindow final : public Window,
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite) const;
/**
@@ -96,7 +96,7 @@ class TradeWindow final : public Window,
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment) const;
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 223b8d18f..47c60bf1c 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -111,7 +111,7 @@ int Inventory::addItem(const int id,
const uint8_t refine,
const uint8_t color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment,
const bool equipped)
@@ -129,7 +129,7 @@ void Inventory::setItem(const int index,
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment,
const bool equipped)
diff --git a/src/inventory.h b/src/inventory.h
index 5e36503f5..4225fc2ae 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -86,7 +86,7 @@ class Inventory final
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment,
const bool equipped);
@@ -101,7 +101,7 @@ class Inventory final
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment,
const bool equipped);
diff --git a/src/item.cpp b/src/item.cpp
index 7b545c9d7..a09b5afc8 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -43,7 +43,7 @@ Item::Item(const int id,
const uint8_t refine,
const unsigned char color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment,
const bool equipped) :
diff --git a/src/item.h b/src/item.h
index df75729ba..011a0da39 100644
--- a/src/item.h
+++ b/src/item.h
@@ -50,7 +50,7 @@ class Item notfinal
const uint8_t refine,
const uint8_t color,
const Identified identified,
- const bool damaged,
+ const Damaged damaged,
const bool favorite,
const bool equipment,
const bool equipped);
@@ -182,10 +182,10 @@ class Item notfinal
Identified getIdentified() const A_WARN_UNUSED
{ return mIdentified; }
- void setDamaged(const bool b)
+ void setDamaged(const Damaged b)
{ mDamaged = b; }
- bool getDamaged() const A_WARN_UNUSED
+ Damaged getDamaged() const A_WARN_UNUSED
{ return mDamaged; }
void setFavorite(const bool b)
@@ -225,7 +225,7 @@ class Item notfinal
bool mEquipped; /**< Item is equipped. */
bool mInEquipment; /**< Item is in equipment */
Identified mIdentified;
- bool mDamaged;
+ Damaged mDamaged;
bool mFavorite;
};
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);
}
}
}
diff --git a/src/shopitem.cpp b/src/shopitem.cpp
index 9370b744e..2871e1853 100644
--- a/src/shopitem.cpp
+++ b/src/shopitem.cpp
@@ -40,7 +40,8 @@ ShopItem::ShopItem(const int inventoryIndex,
const int price) :
Item(id, type, 0, 0, color,
Identified_True,
- false, false, false, false),
+ Damaged_False,
+ false, false, false),
mDisplayName(),
mDuplicates(),
mPrice(price),
@@ -57,7 +58,8 @@ ShopItem::ShopItem(const int id,
const int price) :
Item(id, type, 0, 0, color,
Identified_True,
- false, false, false, false),
+ Damaged_False,
+ false, false, false),
mDisplayName(),
mDuplicates(),
mPrice(price),