summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-21 12:30:17 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-21 12:30:17 +0300
commit40a60a7bb7fd3291fde0a2a689f674a8169c7b64 (patch)
tree9410a23feea6c6248612afdc8968a1c04306e5b0 /src/net
parent76e55447563fae6f8d17f2fd90231c81e0b3f927 (diff)
downloadplus-40a60a7bb7fd3291fde0a2a689f674a8169c7b64.tar.gz
plus-40a60a7bb7fd3291fde0a2a689f674a8169c7b64.tar.bz2
plus-40a60a7bb7fd3291fde0a2a689f674a8169c7b64.tar.xz
plus-40a60a7bb7fd3291fde0a2a689f674a8169c7b64.zip
Add to item field damaged.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/inventoryhandler.cpp1
-rw-r--r--src/net/ea/inventoryitem.h3
-rw-r--r--src/net/eathena/inventoryhandler.cpp17
-rw-r--r--src/net/eathena/tradehandler.cpp2
-rw-r--r--src/net/tmwa/inventoryhandler.cpp24
-rw-r--r--src/net/tmwa/tradehandler.cpp7
6 files changed, 31 insertions, 23 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index c38871797..e43e0de9c 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -284,6 +284,7 @@ void InventoryHandler::processPlayerStorageStatus(Net::MessageIn &msg)
(*it).refine,
(*it).color,
(*it).identified,
+ (*it).damaged,
(*it).equip,
false);
}
diff --git a/src/net/ea/inventoryitem.h b/src/net/ea/inventoryitem.h
index 20ea399d4..19d9135f9 100644
--- a/src/net/ea/inventoryitem.h
+++ b/src/net/ea/inventoryitem.h
@@ -46,6 +46,7 @@ class InventoryItem final
uint8_t refine;
unsigned char color;
bool identified;
+ bool damaged;
bool equip;
InventoryItem(const int slot0,
@@ -54,6 +55,7 @@ class InventoryItem final
const uint8_t refine0,
const unsigned char color0,
const bool identified0,
+ const bool damaged0,
const bool equip0) :
slot(slot0),
id(id0),
@@ -61,6 +63,7 @@ class InventoryItem final
refine(refine0),
color(color0),
identified(identified0),
+ damaged(damaged0),
equip(equip0)
{
}
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index b016b6a17..4189dde81 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -326,7 +326,7 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
if (inventory)
{
inventory->setItem(index, itemId, 1, refine,
- 1, flags.bits.isIdentified, true, false);
+ 1, flags.bits.isIdentified, flags.bits.isDamaged, true, false);
}
if (equipType)
@@ -351,7 +351,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
int amount = msg.readInt16("count");
const int itemId = msg.readInt16("item id");
uint8_t identified = msg.readUInt8("identified");
- msg.readUInt8("is damaged");
+ const uint8_t damaged = msg.readUInt8("is damaged");
const uint8_t refine = msg.readUInt8("refine");
msg.readInt16("card0");
msg.readInt16("card1");
@@ -422,7 +422,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
amount += item->getQuantity();
inventory->setItem(index, itemId, amount, refine,
- 1, identified != 0, equipType != 0, false);
+ 1, identified != 0, damaged != 0, equipType != 0, false);
}
ArrowsListener::distributeEvent();
}
@@ -466,7 +466,8 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
if (inventory)
{
inventory->setItem(index, itemId, amount,
- 0, 1, flags.bits.isIdentified, false, false);
+ 0, 1, flags.bits.isIdentified,
+ flags.bits.isDamaged, false, false);
}
}
BLOCK_END("InventoryHandler::processPlayerInventory")
@@ -498,7 +499,8 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
flags.byte = msg.readUInt8("flags");
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- amount, 0, 1, flags.bits.isIdentified, false));
+ amount, 0, 1, flags.bits.isIdentified,
+ flags.bits.isDamaged, false));
}
BLOCK_END("InventoryHandler::processPlayerInventory")
}
@@ -596,7 +598,8 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
flags.byte = msg.readUInt8("flags");
mInventoryItems.push_back(Ea::InventoryItem(index,
- itemId, amount, refine, 1, flags.bits.isIdentified, false));
+ itemId, amount, refine, 1, flags.bits.isIdentified,
+ flags.bits.isDamaged, false));
}
BLOCK_END("InventoryHandler::processPlayerStorageEquip")
}
@@ -627,7 +630,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
if (mStorage)
{
mStorage->setItem(index, itemId, amount,
- refine, 1, identified != 0, false, false);
+ refine, 1, identified != 0, false, false, false);
}
}
BLOCK_END("InventoryHandler::processPlayerStorageAdd")
diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp
index dffc68057..e992ee497 100644
--- a/src/net/eathena/tradehandler.cpp
+++ b/src/net/eathena/tradehandler.cpp
@@ -201,7 +201,7 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
else
{
tradeWindow->addItem2(type, false, amount,
- refine, 1, identify != 0, false);
+ refine, 1, identify != 0, false, false);
}
}
}
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 32dc8fdc0..6685efd7c 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -271,12 +271,12 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
inventory->setItem(index, itemId, 1, refine,
- identified, true, true, false);
+ identified, true, false, true, false);
}
else
{
inventory->setItem(index, itemId, 1, refine,
- 1, identified != 0, true, false);
+ 1, identified != 0, false, true, false);
}
}
@@ -371,12 +371,12 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
inventory->setItem(index, itemId, amount, refine,
- identified, true, equipType != 0, false);
+ identified, true, false, equipType != 0, false);
}
else
{
inventory->setItem(index, itemId, amount, refine,
- 1, identified != 0, equipType != 0, false);
+ 1, identified != 0, false, equipType != 0, false);
}
}
ArrowsListener::distributeEvent();
@@ -431,12 +431,12 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
inventory->setItem(index, itemId, amount,
- 0, identified, true, isEquipment, false);
+ 0, identified, true, false, isEquipment, false);
}
else
{
inventory->setItem(index, itemId, amount,
- 0, 1, identified != 0, isEquipment, false);
+ 0, 1, identified != 0, false, isEquipment, false);
}
}
}
@@ -474,12 +474,12 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- amount, 0, identified, true, false));
+ amount, 0, identified, true, false, false));
}
else
{
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
- amount, 0, 1, identified != 0, false));
+ amount, 0, 1, identified != 0, false, false));
}
}
BLOCK_END("InventoryHandler::processPlayerInventory")
@@ -547,12 +547,12 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
mInventoryItems.push_back(Ea::InventoryItem(index,
- itemId, amount, refine, identified, true, false));
+ itemId, amount, refine, identified, true, false, false));
}
else
{
mInventoryItems.push_back(Ea::InventoryItem(index,
- itemId, amount, refine, 1, identified != 0, false));
+ itemId, amount, refine, 1, identified != 0, false, false));
}
}
BLOCK_END("InventoryHandler::processPlayerStorageEquip")
@@ -583,12 +583,12 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
mStorage->setItem(index, itemId, amount,
- refine, identified, true, false, false);
+ refine, identified, true, false, false, false);
}
else
{
mStorage->setItem(index, itemId, amount,
- refine, 1, identified != 0, false, false);
+ refine, 1, identified != 0, false, false, false);
}
}
}
diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp
index 5598d3781..c0ced4c42 100644
--- a/src/net/tmwa/tradehandler.cpp
+++ b/src/net/tmwa/tradehandler.cpp
@@ -183,12 +183,12 @@ void TradeHandler::processTradeItemAdd(Net::MessageIn &msg)
if (serverFeatures->haveItemColors())
{
tradeWindow->addItem2(type, false, amount,
- refine, identify, true, false);
+ refine, identify, true, false, false);
}
else
{
tradeWindow->addItem2(type, false, amount,
- refine, 1, identify != 0, false);
+ refine, 1, identify != 0, false, false);
}
}
}
@@ -219,7 +219,8 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg)
{
tradeWindow->addItem2(item->getId(), true,
quantity, item->getRefine(), item->getColor(),
- item->getIdentified(), item->isEquipment());
+ item->getIdentified(), item->getDamaged(),
+ item->isEquipment());
}
item->increaseQuantity(-quantity);
break;