ACE3/addons/interaction/functions/fnc_addPassengerActions.sqf
johnb432 8f46ffd8d5
General - Change count to forEach where appropriate (#9890)
count -> forEach

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-04-04 08:15:26 -03:00

39 lines
816 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: esteldunedain
* Mount unit actions inside passenger submenu.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Player <OBJECT>
* 3: Parameters <ARRAY>
*
* Return Value:
* Children actions <ARRAY>
*
* Example:
* array = [target, player, [params]] call ace_interaction_fnc_addPassengerActions
*
* Public: No
*/
params ["", "", "_parameters"];
_parameters params ["_unit"];
private _namespace = EGVAR(interact_menu,ActNamespace);
private _actionTrees = _namespace getVariable typeOf _unit;
if (isNil "_actionTrees") then {
_actionTrees = [];
};
private _actions = [];
// Mount unit MainActions menu
{
_x params ["_actionData", "_children"];
_actions pushBack [_actionData, _children, _unit];
} forEach (_actionTrees select 0 select 1);
_actions