1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-01 15:40:23 +02:00

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.
This commit is contained in:
Paramat
2018-11-24 10:41:11 +00:00
committed by GitHub
parent a969635322
commit 2e37ee9565
7 changed files with 87 additions and 51 deletions

View File

@ -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);
}
}