diff options
Diffstat (limited to 'src/network/clientpackethandler.cpp')
-rw-r--r-- | src/network/clientpackethandler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index 5a62fec3d..1899b496e 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -384,12 +384,12 @@ void Client::handleCommand_ChatMessage(NetworkPacket *pkt) chatMessage->type = (ChatMessageType) message_type; // @TODO send this to CSM using ChatMessage object - if (!moddingEnabled() || !m_script->on_receiving_message( + if (moddingEnabled() && m_script->on_receiving_message( wide_to_utf8(chatMessage->message))) { - pushToChatQueue(chatMessage); - } else { - // Message was consumed by CSM and should not handled by client, destroying + // Message was consumed by CSM and should not be handled by client delete chatMessage; + } else { + pushToChatQueue(chatMessage); } } |