From 8ac73cce3f9808c8fa48b280635104d9587c9c5a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 9 Sep 2015 14:51:14 +0300 Subject: Remove virtual method call from MessageOut constructor. --- src/net/tmwa/chathandler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa/chathandler.cpp') diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 165d91422..dc0ecbab2 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -107,13 +107,17 @@ void ChatHandler::sendRaw(const std::string &args) const if (pos != std::string::npos) { str = line.substr(0, pos); - outMsg = new MessageOut(static_cast(parseNumber(str))); + const int16_t id = static_cast(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(parseNumber(line))); + const int16_t id = static_cast(parseNumber(line)); + outMsg = new MessageOut(id); + outMsg->writeInt16(id, "packet id"); delete outMsg; return; } -- cgit v1.2.3-70-g09d2