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/eathena | |
parent | 261a118937d8b1cd41cf16d983f880e5957f84b1 (diff) | |
download | mv-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.gz mv-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.bz2 mv-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.xz mv-55cbf74cbe2c40b4592e72621e40f8858fc376d9.zip |
Move cards constants into separate file.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/auctionrecv.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 8 | ||||
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 40 | ||||
-rw-r--r-- | src/net/eathena/itemrecv.cpp | 10 | ||||
-rw-r--r-- | src/net/eathena/mailrecv.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/partyrecv.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/searchstorerecv.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/traderecv.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/vendingrecv.cpp | 6 |
9 files changed, 46 insertions, 36 deletions
diff --git a/src/net/eathena/auctionrecv.cpp b/src/net/eathena/auctionrecv.cpp index e097be551..cc7723e5f 100644 --- a/src/net/eathena/auctionrecv.cpp +++ b/src/net/eathena/auctionrecv.cpp @@ -22,6 +22,8 @@ #include "logger.h" +#include "const/resources/item/cards.h" + #include "net/messagein.h" #include "debug.h" @@ -51,7 +53,7 @@ void AuctionRecv::processAuctionResults(Net::MessageIn &msg) msg.readUInt8("identify"); msg.readUInt8("attribute"); msg.readUInt8("refine"); - for (int d = 0; d < 4; d ++) + for (int d = 0; d < maxCards; d ++) msg.readInt16("card"); msg.readInt32("price"); msg.readInt32("buy now"); diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 2d66f5152..bb6fff382 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -31,6 +31,8 @@ #include "being/mercenaryinfo.h" +#include "const/resources/item/cards.h" + #include "enums/resources/notifytypes.h" #include "particle/particle.h" @@ -94,7 +96,7 @@ void BeingRecv::processBeingChangeLook2(Net::MessageIn &msg) void BeingRecv::processBeingChangeLookCards(Net::MessageIn &msg) { Being *dstBeing = nullptr; - int cards[4]; + int cards[maxCards]; if (!actorManager) { // here can be look from char server @@ -126,7 +128,7 @@ void BeingRecv::processBeingChangeLookCards(Net::MessageIn &msg) if (type != 2) id2 = 1; - for (int f = 0; f < 4; f ++) + for (int f = 0; f < maxCards; f ++) cards[f] = msg.readInt16("card"); if (!dstBeing) @@ -1585,7 +1587,7 @@ void BeingRecv::processBeingViewEquipment(Net::MessageIn &msg) msg.readInt32("location"); msg.readInt32("wear state"); msg.readInt8("refine"); - for (int d = 0; d < 4; d ++) + for (int d = 0; d < maxCards; d ++) msg.readInt16("card"); msg.readInt32("hire expire date (?)"); msg.readInt16("equip type"); diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index ecd0a8257..fcaada26a 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -98,8 +98,8 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) msg.readInt32("location"); const int equipType = msg.readInt32("wear state"); const uint8_t refine = static_cast<uint8_t>(msg.readInt8("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"); msg.readInt32("hire expire date (?)"); msg.readInt16("equip type"); @@ -159,8 +159,8 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) uint8_t identified = msg.readUInt8("identified"); const uint8_t damaged = msg.readUInt8("is damaged"); 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.readInt32("location"); const int itemType = msg.readUInt8("item type"); @@ -289,8 +289,8 @@ void InventoryRecv::processPlayerInventory(Net::MessageIn &msg) const int itemType = msg.readUInt8("item type"); const int amount = msg.readInt16("count"); msg.readInt32("wear state / equip"); - 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"); msg.readInt32("hire expire date (?)"); ItemFlags flags; @@ -332,8 +332,8 @@ void InventoryRecv::processPlayerStorage(Net::MessageIn &msg) const int itemType = msg.readUInt8("item type"); const int amount = msg.readInt16("count"); msg.readInt32("wear state / equip"); - 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"); msg.readInt32("hire expire date (?)"); ItemFlags flags; @@ -488,8 +488,8 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) msg.readInt32("location"); msg.readInt32("wear state"); const uint8_t refine = msg.readUInt8("refine level"); - 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"); msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); @@ -535,8 +535,8 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg) const unsigned char identified = msg.readUInt8("identify"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); 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 (serverVersion >= 8 && packetVersion >= 20150226) { @@ -736,8 +736,8 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg) uint8_t identified = msg.readUInt8("identified"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); 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 (serverVersion >= 8 && packetVersion >= 20150226) { @@ -807,8 +807,8 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) msg.readInt32("location"); msg.readInt32("wear state"); const uint8_t refine = msg.readUInt8("refine level"); - 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"); msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); @@ -856,8 +856,8 @@ void InventoryRecv::processPlayerCartItems(Net::MessageIn &msg) const int itemType = msg.readUInt8("item type"); const int amount = msg.readInt16("count"); msg.readInt32("wear state / equip"); - 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"); msg.readInt32("hire expire date (?)"); ItemFlags flags; @@ -964,7 +964,7 @@ void InventoryRecv::processPlayerRepairList(Net::MessageIn &msg) msg.readInt16("index"); msg.readInt16("item id"); msg.readUInt8("refine"); - for (int d = 0; d < 4; d ++) + for (int d = 0; d < maxCards; d ++) msg.readInt16("card"); } menu = MenuType::RepairWespon; @@ -989,7 +989,7 @@ void InventoryRecv::processPlayerRefineList(Net::MessageIn &msg) msg.readInt16("item index"); msg.readInt16("item id"); msg.readUInt8("refine"); - for (int d = 0; d < 4; d ++) + for (int d = 0; d < maxCards; d ++) msg.readInt16("card"); } menu = MenuType::WeaponeRefine; diff --git a/src/net/eathena/itemrecv.cpp b/src/net/eathena/itemrecv.cpp index de0eacd08..79892ebf7 100644 --- a/src/net/eathena/itemrecv.cpp +++ b/src/net/eathena/itemrecv.cpp @@ -26,6 +26,8 @@ #include "itemcolormanager.h" #include "logger.h" +#include "const/resources/item/cards.h" + #include "net/messagein.h" #include "debug.h" @@ -71,8 +73,8 @@ void ItemRecv::processItemDropped2(Net::MessageIn &msg) msg.readUInt8("identify"), Identified); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); 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 x = msg.readInt16("x"); const int y = msg.readInt16("y"); @@ -145,8 +147,8 @@ void ItemRecv::processItemVisible2(Net::MessageIn &msg) msg.readUInt8("identify"), Identified); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); 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 x = msg.readInt16("x"); const int y = msg.readInt16("y"); diff --git a/src/net/eathena/mailrecv.cpp b/src/net/eathena/mailrecv.cpp index 1198968ac..67ba37cf2 100644 --- a/src/net/eathena/mailrecv.cpp +++ b/src/net/eathena/mailrecv.cpp @@ -92,7 +92,7 @@ void MailRecv::processReadMail(Net::MessageIn &msg) mail->itemIdentify = msg.readUInt8("identify"); mail->itemAttribute = msg.readUInt8("attribute"); mail->itemRefine = msg.readUInt8("refine"); - for (int f = 0; f < 4; f ++) + for (int f = 0; f < maxCards; f ++) mail->card[f] = msg.readInt16("card"); const int msgLen = msg.readUInt8("msg len"); if (msgLen != sz) diff --git a/src/net/eathena/partyrecv.cpp b/src/net/eathena/partyrecv.cpp index b71b8d882..c5f04008f 100644 --- a/src/net/eathena/partyrecv.cpp +++ b/src/net/eathena/partyrecv.cpp @@ -26,6 +26,8 @@ #include "being/localplayer.h" +#include "const/resources/item/cards.h" + #include "enums/resources/notifytypes.h" #include "gui/windows/chatwindow.h" @@ -282,7 +284,7 @@ void PartyRecv::processPartyItemPickup(Net::MessageIn &msg) msg.readUInt8("identify"); msg.readUInt8("attribute"); msg.readUInt8("refine"); - for (int f = 0; f < 4; f++) + for (int f = 0; f < maxCards; f++) msg.readInt16("card"); msg.readInt16("equip location"); msg.readUInt8("item type"); diff --git a/src/net/eathena/searchstorerecv.cpp b/src/net/eathena/searchstorerecv.cpp index 5d2d57265..3fc2c26b8 100644 --- a/src/net/eathena/searchstorerecv.cpp +++ b/src/net/eathena/searchstorerecv.cpp @@ -23,6 +23,8 @@ #include "logger.h" #include "notifymanager.h" +#include "const/resources/item/cards.h" + #include "enums/resources/notifytypes.h" #include "net/messagein.h" @@ -49,7 +51,7 @@ void SearchStoreRecv::processSearchAck(Net::MessageIn &msg) msg.readInt32("price"); msg.readInt16("amount"); msg.readUInt8("refine"); - for (int d = 0; d < 4; d++) + for (int d = 0; d < maxCards; d++) msg.readInt16("card"); // +++ need use ItemColorManager for colors diff --git a/src/net/eathena/traderecv.cpp b/src/net/eathena/traderecv.cpp index 97dc6affd..cdae4788e 100644 --- a/src/net/eathena/traderecv.cpp +++ b/src/net/eathena/traderecv.cpp @@ -77,8 +77,8 @@ void TradeRecv::processTradeItemAdd(Net::MessageIn &msg) const uint8_t identify = msg.readUInt8("identify"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); 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 (serverVersion >= 8 && packetVersion >= 20150226) { diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp index 27e186d40..00618d53d 100644 --- a/src/net/eathena/vendingrecv.cpp +++ b/src/net/eathena/vendingrecv.cpp @@ -84,7 +84,7 @@ void VendingRecv::processItemsList(Net::MessageIn &msg) Being *const being = actorManager->findBeing(id); if (!being) return; - int cards[4]; + int cards[maxCards]; CREATEWIDGETV(mBuyDialog, BuyDialog, being->getName()); mBuyDialog->setMoney(PlayerInfo::getAttribute(Attributes::MONEY)); msg.readInt32("vender id"); @@ -98,7 +98,7 @@ void VendingRecv::processItemsList(Net::MessageIn &msg) msg.readUInt8("identify"); msg.readUInt8("attribute"); msg.readUInt8("refine"); - for (int d = 0; d < 4; d ++) + for (int d = 0; d < maxCards; d ++) cards[d] = msg.readInt16("card"); if (serverVersion >= 8 && packetVersion >= 20150226) { @@ -141,7 +141,7 @@ void VendingRecv::processOpen(Net::MessageIn &msg) msg.readUInt8("identify"); msg.readUInt8("attribute"); msg.readUInt8("refine"); - for (int d = 0; d < 4; d ++) + for (int d = 0; d < maxCards; d ++) msg.readInt16("card"); if (serverVersion >= 8 && packetVersion >= 20150226) { |