From da45286c971a21a4cfc5dbfa54019421a6c47713 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 4 Apr 2024 22:01:10 +0200 Subject: [PATCH 1/3] Handle nil condition --- .../interact_menu/functions/fnc_collectActiveActionTree.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 5ab7af179e9..b628041ea36 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -43,12 +43,14 @@ _origActionData params [ "_distance" ]; +private _result = [_target, ACE_player, _customParams] call _conditionCode; + // Return nothing if the action itself is not active -if !([_target, ACE_player, _customParams] call _conditionCode) exitWith { +if (isNil "_result" || {!_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] // if (_distanceToBasePoint > _distance) exitWith { // [] // }; From e898919ab2071431bc7081c7f38cb6a8b38c2a38 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:22:55 -0700 Subject: [PATCH 2/3] Update addons/interact_menu/functions/fnc_collectActiveActionTree.sqf Co-authored-by: PabstMirror --- addons/interact_menu/functions/fnc_collectActiveActionTree.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index b628041ea36..291ca1bd085 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -44,7 +44,7 @@ _origActionData params [ ]; private _result = [_target, ACE_player, _customParams] call _conditionCode; - +if (isNil "_result") then { ERROR_1("Action [%1] bad condition return",_actionName); _result = false; }; // Return nothing if the action itself is not active if (isNil "_result" || {!_result}) exitWith { [] From 68c44a6600ae8d8ad205d3ba2d424783c060cef6 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 5 Apr 2024 07:00:52 +0200 Subject: [PATCH 3/3] Update fnc_collectActiveActionTree.sqf --- .../functions/fnc_collectActiveActionTree.sqf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 291ca1bd085..a60732c8c0f 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -44,9 +44,16 @@ _origActionData params [ ]; private _result = [_target, ACE_player, _customParams] call _conditionCode; -if (isNil "_result") then { ERROR_1("Action [%1] bad condition return",_actionName); _result = false; }; + +// 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 (isNil "_result" || {!_result}) exitWith { +if (!_result) exitWith { [] };