add exclusion whitelist for known vehicle models w/out flag proxies #3

Merged
hizumi merged 2 commits from bug/update-flag-exclusions into main 2024-01-08 15:02:22 -06:00

View File

@@ -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;