aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authornerzhul <loic.blot@unix-experience.fr>2017-03-13 15:55:30 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-03-13 23:56:05 +0100
commit44ca9c9cb2079fa97068adb8ee894c5ae13a9975 (patch)
tree843345db2e348c8cd89fdff88f6ee88e7dbecd13 /src/network
parent0727bb3ddd9c550ff962af4546bac8cc058bce73 (diff)
downloadminetest-44ca9c9cb2079fa97068adb8ee894c5ae13a9975.tar.gz
minetest-44ca9c9cb2079fa97068adb8ee894c5ae13a9975.tar.bz2
minetest-44ca9c9cb2079fa97068adb8ee894c5ae13a9975.zip
[CSM] Add enable_client_modding param (default: false)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/clientpackethandler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index 97fa93e95..9bcc58110 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -413,7 +413,7 @@ void Client::handleCommand_ChatMessage(NetworkPacket* pkt)
}
// If chat message not consummed by client lua API
- if (!m_script->on_receiving_message(wide_to_utf8(message))) {
+ if (!moddingEnabled() || !m_script->on_receiving_message(wide_to_utf8(message))) {
pushToChatQueue(message);
}
}
@@ -526,7 +526,9 @@ void Client::handleCommand_HP(NetworkPacket* pkt)
player->hp = hp;
- m_script->on_hp_modification(hp);
+ if (moddingEnabled()) {
+ m_script->on_hp_modification(hp);
+ }
if (hp < oldhp) {
// Add to ClientEvent queue