Skip to content

Commit

Permalink
Interaction - Define _actionParams (#10527)
Browse files Browse the repository at this point in the history
  • Loading branch information
OverlordZorn authored Dec 13, 2024
1 parent 23ecf77 commit f6a38c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ private _player = ACE_player;
if ((_origActionData select 10) isNotEqualTo {}) then {
// It should, so make a copy and pass it to the modifierFunction
_origActionData = +_origActionData;
[_target, ACE_player, _origActionData select 6, _origActionData] call (_origActionData select 10);
private _actionParams = _origActionData select 6; // Define _actionParams so its accessible within the statement/condition
[_target, ACE_player, _actionParams, _origActionData] call (_origActionData select 10);
};

_origActionData params [
Expand Down
5 changes: 3 additions & 2 deletions addons/interact_menu/functions/fnc_keyUp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ if (GVAR(actionSelected)) then {
private _savedThis = this;
this = GVAR(selectedTarget);

if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
private _actionParams = _actionData select 6; // Define _actionParams so its accessible within the statement/condition
if ([_target, _player, _actionParams] call (_actionData select 4)) then {
// Call the statement
[_target, _player, _actionData select 6] call (_actionData select 3);
[_target, _player, _actionParams] call (_actionData select 3);

// Clear the conditions caches again if the action was performed
[QGVAR(clearConditionCaches), []] call CBA_fnc_localEvent;
Expand Down
5 changes: 3 additions & 2 deletions addons/interact_menu/functions/fnc_render.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ if (GVAR(openedMenuType) >= 0) then {

// Check the action conditions
private _actionData = GVAR(selectedAction) select 0;
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
private _actionParams = _actionData select 6; // Define _actionParams so its accessible within the statement/condition
if ([_target, _player, _actionParams] call (_actionData select 4)) then {
// Call the statement
[_target, _player, _actionData select 6] call (_actionData select 3);
[_target, _player, _actionParams] call (_actionData select 3);

// Clear the conditions caches again if the action was performed
[QGVAR(clearConditionCaches), []] call CBA_fnc_localEvent;
Expand Down

0 comments on commit f6a38c4

Please sign in to comment.