summaryrefslogtreecommitdiff
path: root/src/net/tmwa/chatrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-30 22:51:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-30 22:51:23 +0300
commitef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2 (patch)
treec3d7c79fca18ac387d0c90512ef3201c92da5890 /src/net/tmwa/chatrecv.cpp
parent22b64d16b613c1e5b26632237879b167024788ab (diff)
downloadManaVerse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.gz
ManaVerse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.bz2
ManaVerse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.xz
ManaVerse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.zip
Move some variables to better scope.
Diffstat (limited to 'src/net/tmwa/chatrecv.cpp')
-rw-r--r--src/net/tmwa/chatrecv.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/tmwa/chatrecv.cpp b/src/net/tmwa/chatrecv.cpp
index d0ac861df..afa501004 100644
--- a/src/net/tmwa/chatrecv.cpp
+++ b/src/net/tmwa/chatrecv.cpp
@@ -129,12 +129,15 @@ void ChatRecv::processGmChat(Net::MessageIn &msg)
return;
}
- std::string chatMsg = msg.readRawString(chatMsgLength, "message");
-
- if (localChatTab != nullptr)
+ if (localChatTab != nullptr &&
+ chatWindow != nullptr)
+ {
+ std::string chatMsg = msg.readRawString(chatMsgLength, "message");
+ chatWindow->addGlobalMessage(chatMsg);
+ }
+ else
{
- if (chatWindow != nullptr)
- chatWindow->addGlobalMessage(chatMsg);
+ msg.readRawString(chatMsgLength, "message");
}
BLOCK_END("ChatRecv::processChat")
}