aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-11-24 10:41:11 +0000
committerGitHub <noreply@github.com>2018-11-24 10:41:11 +0000
commit2e37ee956530b7cd310e0d6cfb8ce3cd8f6973e6 (patch)
tree4f607e1f226fa169c2bd98de531b62cba4de3260 /src/network
parenta969635322576218312be3e32e5b4fcb0359ac05 (diff)
downloadminetest-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.cpp8
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);
}
}