summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
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,