Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction - Define _actionParams #10527

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading