summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-17 18:36:21 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-17 19:19:58 +0300
commit55cbf74cbe2c40b4592e72621e40f8858fc376d9 (patch)
tree1adb70df7ddddde9a504d572a789e7afb5cae58c /src/net/tmwa/inventoryrecv.cpp
parent261a118937d8b1cd41cf16d983f880e5957f84b1 (diff)
downloadmanaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.gz
manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.bz2
manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.xz
manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.zip
Move cards constants into separate file.
Diffstat (limited to 'src/net/tmwa/inventoryrecv.cpp')
-rw-r--r--src/net/tmwa/inventoryrecv.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/net/tmwa/inventoryrecv.cpp b/src/net/tmwa/inventoryrecv.cpp
index 897b8a274..ce59dc274 100644
--- a/src/net/tmwa/inventoryrecv.cpp
+++ b/src/net/tmwa/inventoryrecv.cpp
@@ -68,8 +68,8 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg)
const int equipType = msg.readInt16("equip type");
msg.readUInt8("attribute");
const uint8_t refine = msg.readUInt8("refine");
- int cards[4];
- for (int f = 0; f < 4; f++)
+ int cards[maxCards];
+ for (int f = 0; f < maxCards; f++)
cards[f] = msg.readInt16("card");
if (Ea::InventoryRecv::mDebugInventory)
@@ -121,8 +121,8 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg)
const uint8_t identified = msg.readUInt8("identified");
msg.readUInt8("attribute");
const uint8_t refine = msg.readUInt8("refine");
- int cards[4];
- for (int f = 0; f < 4; f++)
+ int cards[maxCards];
+ for (int f = 0; f < maxCards; f++)
cards[f] = msg.readInt16("card");
const int equipType = msg.readInt16("equip type");
const int type = msg.readUInt8("item type");
@@ -234,14 +234,14 @@ void InventoryRecv::processPlayerInventory(Net::MessageIn &msg)
for (int loop = 0; loop < number; loop++)
{
- int cards[4];
+ int cards[maxCards];
const int index = msg.readInt16("index") - INVENTORY_OFFSET;
const int itemId = msg.readInt16("item id");
const uint8_t itemType = msg.readUInt8("item type");
const uint8_t identified = msg.readUInt8("identified");
const int amount = msg.readInt16("amount");
const int arrow = msg.readInt16("arrow");
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < maxCards; i++)
cards[i] = msg.readInt16("card");
if (Ea::InventoryRecv::mDebugInventory)
@@ -284,14 +284,14 @@ void InventoryRecv::processPlayerStorage(Net::MessageIn &msg)
for (int loop = 0; loop < number; loop++)
{
- int cards[4];
+ int cards[maxCards];
const int index = msg.readInt16("index") - STORAGE_OFFSET;
const int itemId = msg.readInt16("item id");
const uint8_t itemType = msg.readUInt8("item type");
const uint8_t identified = msg.readUInt8("identified");
const int amount = msg.readInt16("amount");
msg.readInt16("arrow");
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < maxCards; i++)
cards[i] = msg.readInt16("card");
if (Ea::InventoryRecv::mDebugInventory)
@@ -362,7 +362,7 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg)
for (int loop = 0; loop < number; loop++)
{
- int cards[4];
+ int cards[maxCards];
const int index = msg.readInt16("index") - STORAGE_OFFSET;
const int itemId = msg.readInt16("item id");
const uint8_t itemType = msg.readUInt8("item type");
@@ -372,7 +372,7 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg)
msg.readInt16("another equip point?");
msg.readUInt8("attribute (broken)");
const uint8_t refine = msg.readUInt8("refine");
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < maxCards; i++)
cards[i] = msg.readInt16("card");
if (Ea::InventoryRecv::mDebugInventory)
@@ -411,8 +411,8 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg)
const unsigned char identified = msg.readUInt8("identified");
msg.readUInt8("attribute");
const uint8_t refine = msg.readUInt8("refine");
- int cards[4];
- for (int f = 0; f < 4; f++)
+ int cards[maxCards];
+ for (int f = 0; f < maxCards; f++)
cards[f] = msg.readInt16("card");
if (Item *const item = Ea::InventoryRecv::mStorage->getItem(index))