diff options
Diffstat (limited to 'src/net/messageout.cpp')
-rw-r--r-- | src/net/messageout.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index 69993e4d8..841e1183d 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -40,6 +40,8 @@ PRAGMA48(GCC diagnostic pop) #error missing SDL_endian.h #endif // SDL_BYTEORDER +extern int itemIdLen; + namespace Net { @@ -98,6 +100,15 @@ void MessageOut::writeInt32(const int32_t value, const char *const str) mPos += 4; } +void MessageOut::writeItemId(const int32_t value, + const char *const str) +{ + if (itemIdLen == 2) + writeInt16(CAST_S32(value), str); + else + writeInt32(value, str); +} + void MessageOut::writeInt64(const int64_t value, const char *const str) { DEBUGLOG2("writeInt64: " + toStringPrint(CAST_U32(value)), |