summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa/inventoryhandler.cpp')
-rw-r--r--src/net/tmwa/inventoryhandler.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index fc32c3ec3..7113cddb3 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -209,6 +209,9 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
cards[0], cards[1], cards[2], cards[3]);
}
+ if (serverVersion < 1 && identified > 1)
+ identified = 1;
+
if (msg.getId() == SMSG_PLAYER_INVENTORY)
{
// Trick because arrows are not considered equipment
@@ -255,6 +258,9 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
refine);
}
+ if (serverVersion < 1 && identified > 1)
+ identified = 1;
+
mInventoryItems.push_back(InventoryItem(index, itemId, amount,
refine, identified, false));
}
@@ -299,6 +305,9 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += inventory->getItem(index)->getQuantity();
+ if (serverVersion < 1 && identified > 1)
+ identified = 1;
+
inventory->setItem(index, itemId, amount, refine,
identified, equipType != 0);
}
@@ -410,6 +419,9 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
{
if (mStorage)
{
+ if (serverVersion < 1 && identified > 1)
+ identified = 1;
+
mStorage->setItem(index, itemId, amount, refine,
identified, false);
}
@@ -458,29 +470,31 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
{
index = msg.readInt16() - INVENTORY_OFFSET;
itemId = msg.readInt16();
- if (itemId == 1172)
- logger->log("step1");
int itemType = msg.readInt8(); // type
identified = msg.readInt8(); // identify flag
+
msg.readInt16(); // equip type
equipType = msg.readInt16();
msg.readInt8(); // attribute
refine = msg.readInt8();
msg.skip(8); // card
- if (itemId == 1172)
- logger->log("step2");
- if (inventory)
- inventory->setItem(index, itemId, 1, refine, identified, true);
-
- if (equipType)
- mEquips.setEquipment(getSlot(equipType), index);
if (debugInventory)
{
logger->log("Index: %d, ID: %d, Type: %d, Identified: %d",
index, itemId, itemType, identified);
}
+
+ if (serverVersion < 1 && identified > 1)
+ identified = 1;
+
+ if (inventory)
+ inventory->setItem(index, itemId, 1, refine, identified, true);
+
+ if (equipType)
+ mEquips.setEquipment(getSlot(equipType), index);
+
}
break;