mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00: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:
parent
a969635322
commit
2e37ee9565
7 changed files with 87 additions and 51 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue