From b3aa7c8970abcc69c5552f4a7723a0b907f5eed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Fri, 20 Mar 2015 22:44:25 -0300 Subject: [PATCH] Make collectActiveActionTree follow mounts correctly --- .../functions/fnc_collectActiveActionTree.sqf | 17 ++++++++++++----- .../functions/fnc_addPassengerActions.sqf | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index f4ae2ff5c1..36d4dc548d 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -17,7 +17,7 @@ EXPLODE_3_PVT(_this,_object,_origAction,_parentPath); EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); -private ["_target","_player","_fullPath","_activeChildren","_action","_actionData","_x"]; +private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_action","_actionData","_x"]; _target = _object; _player = ACE_player; @@ -27,15 +27,22 @@ if !([_target, ACE_player, _origActionData select 6] call (_origActionData selec [] }; +_fullPath = +_parentPath; +_fullPath pushBack (_origActionData select 0); _activeChildren = []; // If there's a statement to dynamically insert children then execute it if !({} isEqualTo (_origActionData select 5)) then { - _activeChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); -}; + _dynamicChildren = [_target, ACE_player, _origActionData select 6] call (_origActionData select 5); -_fullPath = +_parentPath; -_fullPath pushBack (_origActionData select 0); + // Collect dynamic children class actions + { + _action = [_x select 2, _x, _fullPath] call FUNC(collectActiveActionTree); + if ((count _action) > 0) then { + _activeChildren pushBack _action; + }; + } forEach _dynamicChildren; +}; // Collect children class actions { diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 83b702a98b..d4a5da3788 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -27,6 +27,6 @@ _actionTrees = missionNamespace getVariable [_varName, []]; _actions = []; // Mount unit MainActions menu -_actions pushBack (_actionTrees select 0); +_actions pushBack [(_actionTrees select 0) select 0, (_actionTrees select 0) select 1, _unit]; _actions