diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:21:43 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-29 14:18:06 +0100 |
commit | e7c285e3423ddd660447f6a6fc6bbae25f99f386 (patch) | |
tree | 1d700f09a5e96a2a0d390af30581097bdec0bf77 /src/net/tmwa/inventoryhandler.cpp | |
parent | e1a7c1d0ca30c2c4a293ffbff6b9c51c881d23e3 (diff) | |
download | mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.gz mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.bz2 mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.tar.xz mana-e7c285e3423ddd660447f6a6fc6bbae25f99f386.zip |
Apply C++11 fixits
modernize-loop-convert
modernize-deprecated-headers
Diffstat (limited to 'src/net/tmwa/inventoryhandler.cpp')
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 6f32fb3d..7b08d83c 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -158,8 +158,8 @@ void InventoryHandler::handleMessage(MessageIn &msg) identified = msg.readInt8(); amount = msg.readInt16(); msg.readInt16(); // Arrow - for (int i = 0; i < 4; i++) - cards[i] = msg.readInt16(); + for (int &card : cards) + card = msg.readInt16(); index -= (msg.getId() == SMSG_PLAYER_INVENTORY) ? INVENTORY_OFFSET : STORAGE_OFFSET; @@ -195,8 +195,8 @@ void InventoryHandler::handleMessage(MessageIn &msg) msg.readInt16(); // Another Equip Point? msg.readInt8(); // Attribute (broken) msg.readInt8(); // Refine level - for (int i = 0; i < 4; i++) - cards[i] = msg.readInt16(); + for (int &card : cards) + card = msg.readInt16(); if (debugInventory) { @@ -218,8 +218,8 @@ void InventoryHandler::handleMessage(MessageIn &msg) identified = msg.readInt8(); msg.readInt8(); // attribute msg.readInt8(); // refine - for (int i = 0; i < 4; i++) - cards[i] = msg.readInt16(); + for (int &card : cards) + card = msg.readInt16(); msg.readInt16(); // EquipType itemType = msg.readInt8(); @@ -331,8 +331,8 @@ void InventoryHandler::handleMessage(MessageIn &msg) identified = msg.readInt8(); msg.readInt8(); // attribute msg.readInt8(); // refine - for (int i = 0; i < 4; i++) - cards[i] = msg.readInt16(); + for (int &card : cards) + card = msg.readInt16(); if (Item *item = mStorage->getItem(index)) { |