From b4126f7d4cd0c2511d41b828d5068bef02f10a8a Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Wed, 14 Aug 2024 19:27:08 +0200 Subject: [PATCH] Move chat channels ids to defines --- addons/chat/functions/fnc_handleChatMessage.sqf | 2 +- addons/chat/script_component.hpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/chat/functions/fnc_handleChatMessage.sqf b/addons/chat/functions/fnc_handleChatMessage.sqf index 0a6f722..ea28959 100644 --- a/addons/chat/functions/fnc_handleChatMessage.sqf +++ b/addons/chat/functions/fnc_handleChatMessage.sqf @@ -22,7 +22,7 @@ params [["_channel", -1], "", ["_from", ""], ["_text", ""], ["_sender", objNull]]; if (_text == "") exitWith {false}; -if (GVAR(allowGlobalChat) || {!(_channel in [0, 1])}) exitWith {false}; +if (GVAR(allowGlobalChat) || {!(_channel in RESTRICTED_CHANNELS)}) exitWith {false}; if (_sender getVariable [QEGVAR(common,isAdmin), false]) exitWith { [format ["(ADMIN) %1", _from], _text] diff --git a/addons/chat/script_component.hpp b/addons/chat/script_component.hpp index 98ec671..0e57729 100644 --- a/addons/chat/script_component.hpp +++ b/addons/chat/script_component.hpp @@ -12,3 +12,7 @@ #endif #include "\z\afm\addons\main\script_macros.hpp" + +#define CHAT_CHANNEL_GLOBAL 0 +#define CHAT_CHANNEL_SIDE 1 +#define RESTRICTED_CHANNELS [CHAT_CHANNEL_GLOBAL, CHAT_CHANNEL_SIDE]