From 44ca9c9cb2079fa97068adb8ee894c5ae13a9975 Mon Sep 17 00:00:00 2001 From: nerzhul Date: Mon, 13 Mar 2017 15:55:30 +0100 Subject: [CSM] Add enable_client_modding param (default: false) --- src/network/clientpackethandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/network') 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 -- cgit v1.2.3