diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-11-24 10:41:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-24 10:41:11 +0000 |
commit | 2e37ee956530b7cd310e0d6cfb8ce3cd8f6973e6 (patch) | |
tree | 4f607e1f226fa169c2bd98de531b62cba4de3260 /src/network | |
parent | a969635322576218312be3e32e5b4fcb0359ac05 (diff) | |
download | minetest-2e37ee956530b7cd310e0d6cfb8ce3cd8f6973e6.tar.gz minetest-2e37ee956530b7cd310e0d6cfb8ce3cd8f6973e6.tar.bz2 minetest-2e37ee956530b7cd310e0d6cfb8ce3cd8f6973e6.zip |
CSM: Don't create the client script environment if CSM is disabled (#7874)
Use the CSM death formspec when CSM is enabled and use the engine death formspec when CSM is disabled.
Move the CSM death formspec code to a dedicated file.
Diffstat (limited to 'src/network')
-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); } } |