mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make collectActiveActionTree follow mounts correctly
This commit is contained in:
parent
66731c9cdd
commit
b3aa7c8970
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user