From 51b85e9aebb4f69bac02390c3546e94058fe13c6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 25 Mar 2016 00:10:20 +0300 Subject: Fix compilation without C++11 flags. --- src/net/tmwa/buysellrecv.cpp | 2 +- src/net/tmwa/inventoryrecv.cpp | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'src/net/tmwa') 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(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( + 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(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( + 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( + 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( + msg.readUInt8("item type")); const uint8_t identified = msg.readUInt8("identified"); const int amount = 1; msg.readInt16("equip point?"); -- cgit v1.2.3-70-g09d2