diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-17 18:36:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-17 19:19:58 +0300 |
commit | 55cbf74cbe2c40b4592e72621e40f8858fc376d9 (patch) | |
tree | 1adb70df7ddddde9a504d572a789e7afb5cae58c /src/net/tmwa | |
parent | 261a118937d8b1cd41cf16d983f880e5957f84b1 (diff) | |
download | manaverse-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')
-rw-r--r-- | src/net/tmwa/inventoryrecv.cpp | 24 | ||||
-rw-r--r-- | src/net/tmwa/traderecv.cpp | 4 |
2 files changed, 14 insertions, 14 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)) diff --git a/src/net/tmwa/traderecv.cpp b/src/net/tmwa/traderecv.cpp index 48020eca3..feb65c3a6 100644 --- a/src/net/tmwa/traderecv.cpp +++ b/src/net/tmwa/traderecv.cpp @@ -64,8 +64,8 @@ void TradeRecv::processTradeItemAdd(Net::MessageIn &msg) const uint8_t identify = msg.readUInt8("identify"); 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 (tradeWindow) |