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

Interact Menu - Add nil handling for condition #9922

Merged
merged 3 commits into from
Apr 7, 2024
Merged
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
13 changes: 11 additions & 2 deletions addons/interact_menu/functions/fnc_collectActiveActionTree.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,21 @@ _origActionData params [
"_distance"
];

private _result = [_target, ACE_player, _customParams] call _conditionCode;

johnb432 marked this conversation as resolved.
Show resolved Hide resolved
// Handle nil as false
if (isNil "_result") then {
ERROR_1("Action [%1] bad condition return",_actionName);

_result = false;
};

// Return nothing if the action itself is not active
if !([_target, ACE_player, _customParams] call _conditionCode) exitWith {
if (!_result) exitWith {
[]
};

// Return nothing if the action is to far (including checking sub actions) [DISABLED FOR NOW ref #2196]
// Return nothing if the action is too far (including checking sub actions) [DISABLED FOR NOW ref #2196]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes.

Big yikes.

// if (_distanceToBasePoint > _distance) exitWith {
// []
// };
Expand Down