summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-24 23:29:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-24 23:29:04 +0300
commit4e97da8e138b21a5f5bea75e6a8d3211e4f28594 (patch)
treec10d3cad963066a908ebd42041723e110a0c9bf0 /src/net/eathena/inventoryrecv.cpp
parentca0ca278d0c4aed9a6d50bb9a8982f5261151ab8 (diff)
downloadmanaplus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.tar.gz
manaplus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.tar.bz2
manaplus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.tar.xz
manaplus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.zip
Add enum for item types.
Diffstat (limited to 'src/net/eathena/inventoryrecv.cpp')
-rw-r--r--src/net/eathena/inventoryrecv.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index 4d5565d1b..967c74978 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -127,7 +127,9 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg)
{
const int index = msg.readInt16("index") - INVENTORY_OFFSET;
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(
+ msg.readUInt8("item type"),
+ ItemTypeT);
msg.readInt32("location");
const int equipType = msg.readInt32("wear state");
const uint8_t refine = CAST_U8(msg.readInt8("refine"));
@@ -198,7 +200,7 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
for (int f = 0; f < maxCards; f++)
cards[f] = msg.readInt16("card");
const int equipType = msg.readInt32("location");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(msg.readUInt8("item type"), ItemTypeT);
const unsigned char err = msg.readUInt8("result");
msg.readInt32("hire expire date");
msg.readInt16("bind on equip");
@@ -322,7 +324,9 @@ void InventoryRecv::processPlayerInventory(Net::MessageIn &msg)
{
const int index = msg.readInt16("item index") - INVENTORY_OFFSET;
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(
+ msg.readUInt8("item type"),
+ ItemType);
const int amount = msg.readInt16("count");
msg.readInt32("wear state / equip");
int cards[maxCards];
@@ -365,7 +369,9 @@ void InventoryRecv::processPlayerStorage(Net::MessageIn &msg)
{
const int index = msg.readInt16("item index") - STORAGE_OFFSET;
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(
+ msg.readUInt8("item type"),
+ ItemTypeT);
const int amount = msg.readInt16("count");
msg.readInt32("wear state / equip");
int cards[maxCards];
@@ -526,7 +532,9 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg)
{
const int index = msg.readInt16("index") - STORAGE_OFFSET;
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(
+ msg.readUInt8("item type"),
+ ItemTypeT);
const int amount = 1;
msg.readInt32("location");
msg.readInt32("wear state");
@@ -575,7 +583,7 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg)
const int index = msg.readInt16("index") - STORAGE_OFFSET;
const int amount = msg.readInt32("amount");
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("type");
+ const ItemTypeT itemType = fromInt(msg.readUInt8("type"), ItemTypeT);
const unsigned char identified = msg.readUInt8("identify");
const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged);
const uint8_t refine = msg.readUInt8("refine");
@@ -777,7 +785,7 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg)
const int index = msg.readInt16("index") - INVENTORY_OFFSET;
int amount = msg.readInt32("count");
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(msg.readUInt8("item type"), ItemTypeT);
const uint8_t identified = msg.readUInt8("identified");
const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged);
const uint8_t refine = msg.readUInt8("refine");
@@ -853,7 +861,9 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg)
{
const int index = msg.readInt16("index") - INVENTORY_OFFSET;
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(
+ msg.readUInt8("item type"),
+ ItemTypeT);
const int amount = 1;
msg.readInt32("location");
msg.readInt32("wear state");
@@ -905,7 +915,9 @@ void InventoryRecv::processPlayerCartItems(Net::MessageIn &msg)
{
const int index = msg.readInt16("item index") - INVENTORY_OFFSET;
const int itemId = msg.readInt16("item id");
- const int itemType = msg.readUInt8("item type");
+ const ItemTypeT itemType = fromInt(
+ msg.readUInt8("item type"),
+ ItemTypeT);
const int amount = msg.readInt16("count");
msg.readInt32("wear state / equip");
int cards[maxCards];