summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 5b942a2d0..d5888534e 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -42,6 +42,8 @@ PRAGMA48(GCC diagnostic pop)
(CAST_U16((CAST_U8(low)) | \
(CAST_U16(CAST_U8(high))) << 8))
+extern int itemIdLen;
+
namespace Net
{
@@ -208,6 +210,13 @@ uint32_t MessageIn::readUInt32(const char *const str)
return value;
}
+int MessageIn::readItemId(const char *const str)
+{
+ if (itemIdLen == 2)
+ return readUInt16(str);
+ return readInt32(str);
+}
+
BeingId MessageIn::readBeingId(const char *const str)
{
return fromInt(readUInt32(str), BeingId);