summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2019-06-25 21:18:08 +0200
committerSmallJoker <mk939@ymail.com>2019-09-14 19:42:25 +0200
commit23677be951b4dc2b9cc174ceb92f0e0b8e8eb867 (patch)
tree87e8a9bee105bbe77d964e109d0cefd1102f07e7 /src/network
parent720aedb46740ba203b4a0f3e049e368abc4932b3 (diff)
downloadminetest-23677be951b4dc2b9cc174ceb92f0e0b8e8eb867.tar.gz
minetest-23677be951b4dc2b9cc174ceb92f0e0b8e8eb867.tar.bz2
minetest-23677be951b4dc2b9cc174ceb92f0e0b8e8eb867.zip
Load CSM environment after the restrictions are known
Safety-guards for CSM callbacks to abort on a bad implementation Only run callbacks when the mods are loaded (and with it: builtin) Duplication checks inside constructors
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientpackethandler.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index 91829474e..a8ae8a5ef 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -415,7 +415,7 @@ 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 (modsLoaded() && m_script->on_receiving_message(
wide_to_utf8(chatMessage->message))) {
// Message was consumed by CSM and should not be handled by client
delete chatMessage;
@@ -532,9 +532,8 @@ void Client::handleCommand_HP(NetworkPacket* pkt)
player->hp = hp;
- if (moddingEnabled()) {
+ if (modsLoaded())
m_script->on_hp_modification(hp);
- }
if (hp < oldhp) {
// Add to ClientEvent queue