From 2e8651deac5d91938303932c54b31b8d9b1dd347 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 10 Feb 2017 12:49:10 -0600 Subject: [PATCH] Fix passenger actions - Ensure order of MainActions (#4883) --- .../interact_menu/functions/fnc_compileMenu.sqf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 225ebc59b4..ed38e41ada 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -109,6 +109,22 @@ private _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions TRACE_1("Building ACE_Actions",_objectType); private _actions = [_actionsCfg, 0] call _recurseFnc; +// ace_interaction_fnc_addPassengerAction expects ACE_MainActions to be first +// Other mods can change the order that configs are added, so we should verify this now and resort if needed +if (_objectType isKindOf "CaManBase") then { + if ((((_actions select 0) select 0) select 0) != "ACE_MainActions") then { + INFO_1("ACE_MainActions not first for man [%1]",_objectType); + private _mainActions = []; + { + if (((_x select 0) select 0) == "ACE_MainActions") then { + _mainActions = _actions deleteAt _forEachIndex; + }; + } forEach _actions; + if (_mainActions isEqualTo []) exitWith {ERROR_1("ACE_MainActions not found on man [%1]",_objectType);}; + _actions = [_mainActions] + _actions; // resort array with ACE_MainActions first + }; +}; + _namespace setVariable [_objectType, _actions]; /*