From 0301758e28844c23c898d4b599f1b2a4f42d7913 Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Sun, 7 Jan 2024 19:28:38 -0800 Subject: [PATCH] add exclusion whitelist for known vehicle models w/out flag proxies --- functions/client/fn_initVehicleFlags.sqf | 34 +++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/functions/client/fn_initVehicleFlags.sqf b/functions/client/fn_initVehicleFlags.sqf index 21409b2..20c2e02 100644 --- a/functions/client/fn_initVehicleFlags.sqf +++ b/functions/client/fn_initVehicleFlags.sqf @@ -85,6 +85,16 @@ private _appliedParentClasses = [ "Helicopter" ]; +private _modelsWithoutFlagProxies = [ + "TF373_SOAR_MH47G_Base", // MH-47G Chinook + "RHS_MELB_base", // MELB AH-6M/MH-6M/H-6M Little Bird + "USAF_C17", // C17 Globemaster III + "USAF_C130J", // C130J Super Hercules + "USAF_AC130U", // AC130 Spooky II + "ej_UH60M_base", // UH-60M Black Hawk + DAP variants + "rhsusf_fmtv_base" // M1083A1P2 variants + SOV SOCOM variants +]; + { private _parentClass = _x; [_parentClass, "InitPost", { @@ -94,7 +104,22 @@ private _appliedParentClasses = [ "Set Vehicle Flag", // displayed title "\A3\ui_f\data\map\markers\flags\nato_ca.paa", // flag icon {true}, // statement - {true}, // condition + { + params ["_target", "_player", "_params"]; + private _modelsWithoutFlagProxies = _params select 1; + + // check if hierarchy includes any of the models without flag proxies + private _excluded = false; + { + if (_excluded) exitWith {false}; + _excluded = _target isKindOf _x; + } forEach _modelsWithoutFlagProxies; + if (_excluded) exitWith {false}; + + + // check if vehicle is alive + alive _target; + }, // condition { params ["_target", "_player", "_params"]; private _flagActionID = _params#0; @@ -155,7 +180,7 @@ private _appliedParentClasses = [ _actions; }, // child code - [_flagActionID], // params + [_flagActionID, _modelsWithoutFlagProxies], // params nil, // position 4, // distance [false, false, false, false, false], // other params @@ -180,7 +205,10 @@ private _appliedParentClasses = [ params ["_target", "_player", "_params"]; _target forceFlagTexture ""; }, // statement - {true}, // condition + { + params ["_target", "_player", "_params"]; + alive _target && getForcedFlagTexture _target != ""; + }, // condition nil // child code ] call ace_interact_menu_fnc_createAction; -- 2.37.3.windows.1