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/tmwa | |
parent | 4e97da8e138b21a5f5bea75e6a8d3211e4f28594 (diff) | |
download | plus-51b85e9aebb4f69bac02390c3546e94058fe13c6.tar.gz plus-51b85e9aebb4f69bac02390c3546e94058fe13c6.tar.bz2 plus-51b85e9aebb4f69bac02390c3546e94058fe13c6.tar.xz plus-51b85e9aebb4f69bac02390c3546e94058fe13c6.zip |
Fix compilation without C++11 flags.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/buysellrecv.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/inventoryrecv.cpp | 22 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/net/tmwa/buysellrecv.cpp b/src/net/tmwa/buysellrecv.cpp index 625cb2a14..efc7a9172 100644 --- a/src/net/tmwa/buysellrecv.cpp +++ b/src/net/tmwa/buysellrecv.cpp @@ -54,7 +54,7 @@ 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/tmwa/inventoryrecv.cpp b/src/net/tmwa/inventoryrecv.cpp index 605f08bbe..9d4d202a0 100644 --- a/src/net/tmwa/inventoryrecv.cpp +++ b/src/net/tmwa/inventoryrecv.cpp @@ -93,9 +93,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")); const uint8_t identified = msg.readUInt8("identify"); msg.readInt16("equip type?"); const int equipType = msg.readInt16("equip type"); @@ -159,7 +158,7 @@ void InventoryRecv::processPlayerInventoryAdd(Net::MessageIn &msg) for (int f = 0; f < maxCards; f++) cards[f] = msg.readInt16("card"); const int equipType = msg.readInt16("equip type"); - const ItemTypeT type = fromInt(msg.readUInt8("item type"), ItemTypeT); + const ItemTypeT type = static_cast<ItemTypeT>(msg.readUInt8("item type")); const ItemInfo &itemInfo = ItemDB::get(itemId); const unsigned char err = msg.readUInt8("status"); BeingId floorId; @@ -270,9 +269,8 @@ void InventoryRecv::processPlayerInventory(Net::MessageIn &msg) int cards[maxCards]; 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 uint8_t identified = msg.readUInt8("identified"); const int amount = msg.readInt16("amount"); const int arrow = msg.readInt16("arrow"); @@ -322,9 +320,8 @@ void InventoryRecv::processPlayerStorage(Net::MessageIn &msg) int cards[maxCards]; 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 uint8_t identified = msg.readUInt8("identified"); const int amount = msg.readInt16("amount"); msg.readInt16("arrow"); @@ -404,9 +401,8 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg) int cards[maxCards]; 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 uint8_t identified = msg.readUInt8("identified"); const int amount = 1; msg.readInt16("equip point?"); |