diff options
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/chathandler.cpp | 9 | ||||
-rw-r--r-- | src/net/eathena/messageout.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/messageout.h | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index c3f8bf039..da32981dd 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -106,13 +106,18 @@ void ChatHandler::sendRaw(const std::string &args) const if (pos != std::string::npos) { str = line.substr(0, pos); - outMsg = new MessageOut(static_cast<int16_t>(parseNumber(str))); + + const int16_t id = static_cast<int16_t>(parseNumber(str)); + outMsg = new MessageOut(id); + outMsg->writeInt16(id, "packet id"); line = line.substr(pos + 1); pos = line.find(" "); } else { - outMsg = new MessageOut(static_cast<int16_t>(parseNumber(line))); + const int16_t id = static_cast<int16_t>(parseNumber(line)); + outMsg = new MessageOut(id); + outMsg->writeInt16(id, "packet id"); delete outMsg; return; } diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp index 8ecf8e863..0e42bec28 100644 --- a/src/net/eathena/messageout.cpp +++ b/src/net/eathena/messageout.cpp @@ -35,15 +35,12 @@ namespace EAthena { -MessageOut::MessageOut(const int16_t id, const char *const str) : +MessageOut::MessageOut(const int16_t id) : Net::MessageOut(id), mNetwork(EAthena::Network::instance()) { mNetwork->fixSendBuffer(); mData = mNetwork->mOutBuffer + static_cast<size_t>(mNetwork->mOutSize); - - // +++ can be issue. call to virtual member - writeInt16(id, str); } void MessageOut::expand(const size_t bytes) diff --git a/src/net/eathena/messageout.h b/src/net/eathena/messageout.h index 4c0074767..8940ccc6a 100644 --- a/src/net/eathena/messageout.h +++ b/src/net/eathena/messageout.h @@ -43,8 +43,7 @@ class MessageOut final : public Net::MessageOut /** * Constructor. */ - explicit MessageOut(const int16_t id, - const char *const str = "packet id"); + explicit MessageOut(const int16_t id); A_DELETE_COPY(MessageOut) |