diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-25 00:10:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-25 00:10:20 +0300 |
commit | 51b85e9aebb4f69bac02390c3546e94058fe13c6 (patch) | |
tree | 02d0e0a3ee5b9f0517f43b954a62cd7b15c5f28a /src/net/eathena | |
parent | 4e97da8e138b21a5f5bea75e6a8d3211e4f28594 (diff) | |
download | mv-51b85e9aebb4f69bac02390c3546e94058fe13c6.tar.gz mv-51b85e9aebb4f69bac02390c3546e94058fe13c6.tar.bz2 mv-51b85e9aebb4f69bac02390c3546e94058fe13c6.tar.xz mv-51b85e9aebb4f69bac02390c3546e94058fe13c6.zip |
Fix compilation without C++11 flags.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/buyingstorerecv.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/buysellrecv.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/cashshoprecv.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/inventoryrecv.cpp | 39 | ||||
-rw-r--r-- | src/net/eathena/itemrecv.cpp | 7 | ||||
-rw-r--r-- | src/net/eathena/markethandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/marketrecv.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/traderecv.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/vendingrecv.cpp | 3 |
9 files changed, 34 insertions, 33 deletions
diff --git a/src/net/eathena/buyingstorerecv.cpp b/src/net/eathena/buyingstorerecv.cpp index 89a756ad3..71396df4c 100644 --- a/src/net/eathena/buyingstorerecv.cpp +++ b/src/net/eathena/buyingstorerecv.cpp @@ -134,9 +134,8 @@ void BuyingStoreRecv::processBuyingStoreItemsList(Net::MessageIn &msg) { const int price = msg.readInt32("price"); const int amount = msg.readInt16("amount"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int itemId = msg.readInt16("item id"); if (!inv) diff --git a/src/net/eathena/buysellrecv.cpp b/src/net/eathena/buysellrecv.cpp index 8fa02d185..acf53def6 100644 --- a/src/net/eathena/buysellrecv.cpp +++ b/src/net/eathena/buysellrecv.cpp @@ -55,7 +55,8 @@ void BuySellRecv::processNpcBuy(Net::MessageIn &msg) { const int value = msg.readInt32("price"); msg.readInt32("dc value?"); - const ItemTypeT type = fromInt(msg.readUInt8("type"), ItemTypeT); + const ItemTypeT type = static_cast<ItemTypeT>( + msg.readUInt8("type")); const int itemId = msg.readInt16("item id"); const ItemColor color = ItemColor_one; Ea::BuySellRecv::mBuyDialog->addItem(itemId, type, color, 0, value); diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp index 4da1edcf3..2cffcd40a 100644 --- a/src/net/eathena/cashshoprecv.cpp +++ b/src/net/eathena/cashshoprecv.cpp @@ -51,7 +51,8 @@ void CashShopRecv::processCashShopOpen(Net::MessageIn &msg) { msg.readInt32("price"); const int value = msg.readInt32("discount price"); - const ItemTypeT type = fromInt(msg.readUInt8("item type"), ItemTypeT); + const ItemTypeT type = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int itemId = msg.readInt16("item id"); const ItemColor color = ItemColor_one; mBuyDialog->addItem(itemId, type, color, 0, value); diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp index 967c74978..600048cb5 100644 --- a/src/net/eathena/inventoryrecv.cpp +++ b/src/net/eathena/inventoryrecv.cpp @@ -127,9 +127,8 @@ void InventoryRecv::processPlayerEquipment(Net::MessageIn &msg) { const int index = msg.readInt16("index") - INVENTORY_OFFSET; const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); msg.readInt32("location"); const int equipType = msg.readInt32("wear state"); const uint8_t refine = CAST_U8(msg.readInt8("refine")); @@ -200,7 +199,8 @@ 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 ItemTypeT itemType = fromInt(msg.readUInt8("item type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const unsigned char err = msg.readUInt8("result"); msg.readInt32("hire expire date"); msg.readInt16("bind on equip"); @@ -324,9 +324,8 @@ void InventoryRecv::processPlayerInventory(Net::MessageIn &msg) { const int index = msg.readInt16("item index") - INVENTORY_OFFSET; const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemType); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int amount = msg.readInt16("count"); msg.readInt32("wear state / equip"); int cards[maxCards]; @@ -369,9 +368,8 @@ void InventoryRecv::processPlayerStorage(Net::MessageIn &msg) { const int index = msg.readInt16("item index") - STORAGE_OFFSET; const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int amount = msg.readInt16("count"); msg.readInt32("wear state / equip"); int cards[maxCards]; @@ -532,9 +530,8 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) { const int index = msg.readInt16("index") - STORAGE_OFFSET; const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int amount = 1; msg.readInt32("location"); msg.readInt32("wear state"); @@ -583,7 +580,8 @@ 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 ItemTypeT itemType = fromInt(msg.readUInt8("type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("type")); const unsigned char identified = msg.readUInt8("identify"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); @@ -785,7 +783,8 @@ 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 ItemTypeT itemType = fromInt(msg.readUInt8("item type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const uint8_t identified = msg.readUInt8("identified"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); const uint8_t refine = msg.readUInt8("refine"); @@ -861,9 +860,8 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg) { const int index = msg.readInt16("index") - INVENTORY_OFFSET; const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int amount = 1; msg.readInt32("location"); msg.readInt32("wear state"); @@ -915,9 +913,8 @@ void InventoryRecv::processPlayerCartItems(Net::MessageIn &msg) { const int index = msg.readInt16("item index") - INVENTORY_OFFSET; const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt( - msg.readUInt8("item type"), - ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int amount = msg.readInt16("count"); msg.readInt32("wear state / equip"); int cards[maxCards]; diff --git a/src/net/eathena/itemrecv.cpp b/src/net/eathena/itemrecv.cpp index 80b0bd7a2..4a744dccb 100644 --- a/src/net/eathena/itemrecv.cpp +++ b/src/net/eathena/itemrecv.cpp @@ -41,7 +41,7 @@ void ItemRecv::processItemDropped(Net::MessageIn &msg) { const BeingId id = msg.readBeingId("id"); const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt(msg.readInt16("type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>(msg.readInt16("type")); const Identified identified = fromInt( msg.readUInt8("identify"), Identified); const int x = msg.readInt16("x"); @@ -70,7 +70,7 @@ void ItemRecv::processItemDropped2(Net::MessageIn &msg) { const BeingId id = msg.readBeingId("id"); const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt(msg.readUInt8("type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>(msg.readUInt8("type")); const Identified identified = fromInt( msg.readUInt8("identify"), Identified); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); @@ -144,7 +144,8 @@ void ItemRecv::processItemVisible2(Net::MessageIn &msg) { const BeingId id = msg.readBeingId("item object id"); const int itemId = msg.readInt16("item id"); - const ItemTypeT itemType = fromInt(msg.readUInt8("type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("type")); const Identified identified = fromInt( msg.readUInt8("identify"), Identified); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index 15370d91c..2aeaf6787 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -106,7 +106,7 @@ void MarketHandler::buyItems(const std::vector<ShopItem*> &items) const item->increaseQuantity(usedQuantity); item->increaseUsedQuantity(-usedQuantity); item->update(); - const ItemTypeT type = fromInt(item->getType(), ItemTypeT); + const ItemTypeT type = item->getType(); if (type == ItemType::Weapon || type == ItemType::Armor || type == ItemType::PetEgg || diff --git a/src/net/eathena/marketrecv.cpp b/src/net/eathena/marketrecv.cpp index 66cab540a..18436e33b 100644 --- a/src/net/eathena/marketrecv.cpp +++ b/src/net/eathena/marketrecv.cpp @@ -53,7 +53,7 @@ void MarketRecv::processMarketOpen(Net::MessageIn &msg) for (int f = 0; f < len; f ++) { const int itemId = msg.readInt16("item id"); - const ItemTypeT type = fromInt(msg.readUInt8("type"), ItemTypeT); + const ItemTypeT type = static_cast<ItemTypeT>(msg.readUInt8("type")); const int value = msg.readInt32("price"); const int amount = msg.readInt32("amount"); msg.readInt16("view"); diff --git a/src/net/eathena/traderecv.cpp b/src/net/eathena/traderecv.cpp index edac5d21e..e9d7537bf 100644 --- a/src/net/eathena/traderecv.cpp +++ b/src/net/eathena/traderecv.cpp @@ -72,7 +72,8 @@ void TradeRecv::processTradeResponse(Net::MessageIn &msg) void TradeRecv::processTradeItemAdd(Net::MessageIn &msg) { const int type = msg.readInt16("type"); - const ItemTypeT itemType = fromInt(msg.readUInt8("item type"), ItemTypeT); + const ItemTypeT itemType = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int amount = msg.readInt32("amount"); const uint8_t identify = msg.readUInt8("identify"); const Damaged damaged = fromBool(msg.readUInt8("attribute"), Damaged); diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp index 06cdfa44c..f4e38f789 100644 --- a/src/net/eathena/vendingrecv.cpp +++ b/src/net/eathena/vendingrecv.cpp @@ -93,7 +93,8 @@ void VendingRecv::processItemsList(Net::MessageIn &msg) const int value = msg.readInt32("price"); const int amount = msg.readInt16("amount"); const int index = msg.readInt16("inv index"); - const ItemTypeT type = fromInt(msg.readUInt8("item type"), ItemTypeT); + const ItemTypeT type = static_cast<ItemTypeT>( + msg.readUInt8("item type")); const int itemId = msg.readInt16("item id"); msg.readUInt8("identify"); msg.readUInt8("attribute"); |