summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-25 00:10:20 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-25 00:10:20 +0300
commit51b85e9aebb4f69bac02390c3546e94058fe13c6 (patch)
tree02d0e0a3ee5b9f0517f43b954a62cd7b15c5f28a /src/net/tmwa/inventoryrecv.cpp
parent4e97da8e138b21a5f5bea75e6a8d3211e4f28594 (diff)
downloadplus-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/inventoryrecv.cpp')
-rw-r--r--src/net/tmwa/inventoryrecv.cpp22
1 files changed, 9 insertions, 13 deletions
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?");