summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-26 16:21:43 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-29 14:18:06 +0100
commite7c285e3423ddd660447f6a6fc6bbae25f99f386 (patch)
tree1d700f09a5e96a2a0d390af30581097bdec0bf77 /src/net/tmwa
parente1a7c1d0ca30c2c4a293ffbff6b9c51c881d23e3 (diff)
downloadmana-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')
-rw-r--r--src/net/tmwa/inventoryhandler.cpp16
-rw-r--r--src/net/tmwa/network.cpp2
2 files changed, 9 insertions, 9 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))
{
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp
index d0a5dc62..c1862f00 100644
--- a/src/net/tmwa/network.cpp
+++ b/src/net/tmwa/network.cpp
@@ -31,7 +31,7 @@
#include "utils/gettext.h"
#include "utils/stringutils.h"
-#include <assert.h>
+#include <cassert>
#include <sstream>
/** Warning: buffers and other variables are shared,