summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-10 13:44:10 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-10 22:49:59 +0300
commitf3f7879c48fe8e202c3519cd465225645949167e (patch)
tree898a86c3446d988e86d7c3f160036533bdfd6475 /src/net/tmwa
parent37d7bd3163ad58391df36363b6f0135c638fbeb8 (diff)
downloadmv-f3f7879c48fe8e202c3519cd465225645949167e.tar.gz
mv-f3f7879c48fe8e202c3519cd465225645949167e.tar.bz2
mv-f3f7879c48fe8e202c3519cd465225645949167e.tar.xz
mv-f3f7879c48fe8e202c3519cd465225645949167e.zip
Add typed bool type Identified.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/inventoryhandler.cpp45
-rw-r--r--src/net/tmwa/tradehandler.cpp27
2 files changed, 53 insertions, 19 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index b0dcca900..efaff9567 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -25,6 +25,7 @@
#include "notifymanager.h"
#include "enums/equipslot.h"
+#include "enums/simpletypes.h"
#include "being/localplayer.h"
@@ -296,12 +297,16 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
inventory->setItem(index, itemId, itemType, 1, refine,
- identified, true, false, false, true, false);
+ identified,
+ Identified_True,
+ false, false, true, false);
}
else
{
inventory->setItem(index, itemId, itemType, 1, refine,
- 1, identified != 0, false, false, true, false);
+ 1,
+ fromBool(identified, Identified),
+ false, false, true, false);
}
inventory->setCards(index, cards, 4);
}
@@ -398,12 +403,16 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
inventory->setItem(index, itemId, type, amount, refine,
- identified, true, false, false, equipType != 0, false);
+ identified,
+ Identified_True,
+ false, false, equipType != 0, false);
}
else
{
inventory->setItem(index, itemId, type, amount, refine,
- 1, identified != 0, false, false, equipType != 0, false);
+ 1,
+ fromBool(identified, Identified),
+ false, false, equipType != 0, false);
}
inventory->setCards(index, cards, 4);
}
@@ -459,12 +468,16 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
inventory->setItem(index, itemId, itemType, amount,
- 0, identified, true, false, false, isEquipment, false);
+ 0, identified,
+ Identified_True,
+ false, false, isEquipment, false);
}
else
{
inventory->setItem(index, itemId, itemType, amount,
- 0, 1, identified != 0, false, false, isEquipment, false);
+ 0, 1,
+ fromBool(identified, Identified),
+ false, false, isEquipment, false);
}
inventory->setCards(index, cards, 4);
}
@@ -504,13 +517,15 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
itemType, cards, amount, 0, identified,
- true, false, false, false));
+ Identified_True,
+ false, false, false));
}
else
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
itemType, cards, amount, 0, 1,
- identified != 0, false, false, false));
+ fromBool(identified, Identified),
+ false, false, false));
}
}
BLOCK_END("InventoryHandler::processPlayerInventory")
@@ -578,13 +593,15 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- itemType, cards, amount, refine, identified, true,
+ itemType, cards, amount, refine, identified,
+ Identified_True,
false, false, false));
}
else
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- itemType, cards, amount, refine, 1, identified != 0,
+ itemType, cards, amount, refine, 1,
+ fromBool(identified, Identified),
false, false, false));
}
}
@@ -617,12 +634,16 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
mStorage->setItem(index, itemId, 0, amount,
- refine, identified, true, false, false, false, false);
+ refine, identified,
+ Identified_True,
+ false, false, false, false);
}
else
{
mStorage->setItem(index, itemId, 0, amount,
- refine, 1, identified != 0, false, false, false, false);
+ refine, 1,
+ fromBool(identified, Identified),
+ false, false, false, false);
}
mStorage->setCards(index, cards, 4);
}
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index f16ee8c1f..53336bb24 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -29,6 +29,8 @@
#include "being/playerinfo.h"
#include "being/playerrelations.h"
+#include "enums/simpletypes.h"
+
#include "gui/windows/confirmdialog.h"
#include "gui/windows/tradewindow.h"
@@ -192,14 +194,18 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
tradeWindow->addItem2(type, 0,
cards, 4,
false, amount,
- refine, identify, true, false, false, false);
+ refine,
+ identify,
+ Identified_True, false, false, false);
}
else
{
tradeWindow->addItem2(type, 0,
cards, 4,
false, amount,
- refine, 1, identify != 0, false, false, false);
+ refine, 1,
+ fromBool(identify, Identified),
+ false, false, false);
}
}
}
@@ -228,11 +234,18 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg)
// Successfully added item
if (tradeWindow)
{
- tradeWindow->addItem2(item->getId(), item->getType(),
- item->getCards(), 4,
- true, quantity, item->getRefine(), item->getColor(),
- item->getIdentified(), item->getDamaged(),
- item->getFavorite(), item->isEquipment());
+ tradeWindow->addItem2(item->getId(),
+ item->getType(),
+ item->getCards(),
+ 4,
+ true,
+ quantity,
+ item->getRefine(),
+ item->getColor(),
+ item->getIdentified(),
+ item->getDamaged(),
+ item->getFavorite(),
+ item->isEquipment());
}
item->increaseQuantity(-quantity);
break;