diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/chathandler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index d3dcd2b1..e1d68f22 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -75,8 +75,14 @@ void ChatHandler::handleMessage(MessageIn &msg) switch (msg.getId()) { case GPMSG_SAY: - being = beingManager->findBeing(msg.readInt16()); + int id = msg.readInt16(); chatMsg = msg.readString(); + if (id == 0) + { + chatWindow->chatLog(chatMsg, BY_SERVER); + break; + } + being = beingManager->findBeing(id); if (being) { chatWindow->chatLog(being->getName() + " : " + chatMsg, being == player_node ? BY_PLAYER : BY_OTHER); @@ -84,7 +90,7 @@ void ChatHandler::handleMessage(MessageIn &msg) } else { - chatWindow->chatLog("John Doe : " + chatMsg, BY_OTHER); + chatWindow->chatLog("Unknown : " + chatMsg, BY_OTHER); } break; case CPMSG_REGISTER_CHANNEL_RESPONSE: |