From 5f623049654284ea6ebdcd8f357f78989fe7d734 Mon Sep 17 00:00:00 2001 From: Valmo Trindade Date: Wed, 28 May 2025 00:32:37 -0300 Subject: [PATCH] change if hell to switchcase on 3denCoremodule config func --- .../functions/fnc_3denCoreModuleConfig.sqf | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/addons/server/functions/fnc_3denCoreModuleConfig.sqf b/addons/server/functions/fnc_3denCoreModuleConfig.sqf index 35fe090..6aaf892 100644 --- a/addons/server/functions/fnc_3denCoreModuleConfig.sqf +++ b/addons/server/functions/fnc_3denCoreModuleConfig.sqf @@ -31,19 +31,21 @@ if (isServer) exitWith { { _objectType = _x call BIS_fnc_objectType; - if ((_objectType select 0) == "Soldier") then { - _callsign = [_x] call armatak_fnc_extract_unit_callsign; - _group_name = [group _x] call armatak_fnc_extract_group_color; - _group_role = [_x] call armatak_fnc_extract_group_role; + switch (true) do { + case ((_objectType select 0) == "Soldier"): { + _callsign = [_x] call armatak_fnc_extract_unit_callsign; + _group_name = [group _x] call armatak_fnc_extract_group_color; + _group_role = [_x] call armatak_fnc_extract_group_role; - [_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot; - [_x] call armatak_fnc_send_digital_pointer_cot; - }; - if ((_objectType select 0) == "Vehicle") then { - _atak_type = [_x] call armatak_fnc_extract_role; - _callsign = [_x] call armatak_fnc_extract_marker_callsign; + [_x, _callsign, _group_name, _group_role] call armatak_fnc_send_eud_cot; + [_x] call armatak_fnc_send_digital_pointer_cot; + }; + case ((_objectType select 0) == "Vehicle"): { + _atak_type = [_x] call armatak_fnc_extract_role; + _callsign = [_x] call armatak_fnc_extract_marker_callsign; - [_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot; + [_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot; + }; }; if (unitIsUAV _x) then { [_x] call armatak_fnc_send_drone_cot;