From 2bd8a160790ce329878d95ad9ae9057638b51d0c Mon Sep 17 00:00:00 2001 From: hizumi <> Date: Sun, 25 May 2025 22:48:53 -0500 Subject: [PATCH] Update fn_bindEventHandlers.sqf correct logic for handling chat messages based on allowed channel cba settings --- .../client/functions/fn_bindEventHandlers.sqf | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/framework/client/functions/fn_bindEventHandlers.sqf b/framework/client/functions/fn_bindEventHandlers.sqf index 4ceb134..4c7ecb5 100644 --- a/framework/client/functions/fn_bindEventHandlers.sqf +++ b/framework/client/functions/fn_bindEventHandlers.sqf @@ -14,21 +14,18 @@ if ( !hasInterface ) exitWith {}; addMissionEventHandler ["HandleChatMessage", { params ["_channel", "_owner", "_from", "_text", "_person", "_name", "_strID", "_forcedDisplay", "_isPlayerMessage", "_sentenceType", "_chatMessageType"]; - - if ( missionNamespace getVariable ["milsim_globalChat", false] ) exitWith{ false }; - if ( missionNamespace getVariable ["milsim_sideChat", false] ) exitWith{ false }; - if ( missionNamespace getVariable ["milsim_commandChat", false] ) exitWith{ false }; - if ( missionNamespace getVariable ["milsim_groupChat", false] ) exitWith{ false }; - if ( missionNamespace getVariable ["milsim_vehicleChat", false] ) exitWith{ false }; - if ( missionNamespace getVariable ["milsim_directChat", false] ) exitWith{ false }; - - - if (_channel != 1) exitWith { false }; - + if ( ( admin _owner ) != 0 ) exitWith { false }; if ( !isNull ( getAssignedCuratorLogic _person ) ) exitWith { false }; + if ( (missionNamespace getVariable ["milsim_globalChat", false] ) && ( _channel == 0 ) ) exitWith{ false }; + if ( (missionNamespace getVariable ["milsim_sideChat", false] ) && ( _channel == 1 ) ) exitWith{ false }; + if ( (missionNamespace getVariable ["milsim_commandChat", false] && ( _channel == 2 ) ) ) exitWith{ false }; + if ( (missionNamespace getVariable ["milsim_groupChat", false] ) && ( _channel == 3 ) ) exitWith{ false }; + if ( (missionNamespace getVariable ["milsim_vehicleChat", false] && ( _channel == 4 ) ) ) exitWith{ false }; + if ( (missionNamespace getVariable ["milsim_directChat", false] ) && ( _channel == 5 ) ) exitWith{ false }; + true; } ];