diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 2b5150a0ea..4ede3196fe 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -30,7 +30,6 @@ GVAR(lastTime) = diag_tickTime; GVAR(rotationAngle) = 0; GVAR(selectedAction) = [[],[]]; -GVAR(selectedStatement) = {}; GVAR(actionSelected) = false; GVAR(selectedTarget) = objNull; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 69f9697449..db22b65669 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -14,9 +14,19 @@ if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); + + private ["_player","_target","_actionData"]; _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement); + + // Clear the conditions caches + ["clearConditionCaches", []] call EFUNC(common,localEvent); + + // Check the action conditions + _actionData = GVAR(selectedAction) select 0; + if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { + [_target, _player, _actionData select 6] call (_actionData select 3); + }; }; if (GVAR(keyDown)) then { diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf index dd54490532..470a5218db 100644 --- a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf @@ -18,9 +18,19 @@ if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { if(GVAR(actionSelected)) then { this = GVAR(selectedTarget); + + private ["_player","_target","_actionData"]; _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement); + + // Clear the conditions caches + ["clearConditionCaches", []] call EFUNC(common,localEvent); + + // Check the action conditions + _actionData = GVAR(selectedAction) select 0; + if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { + [_target, _player, _actionData select 6] call (_actionData select 3); + }; }; if (GVAR(keyDownSelfAction)) then { diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index df97b232de..98956bd339 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -144,7 +144,6 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { GVAR(actionSelected) = true; GVAR(selectedAction) = (_closest select 0) select 1; GVAR(selectedTarget) = (GVAR(selectedAction)) select 2; - GVAR(selectedStatement) = ((GVAR(selectedAction)) select 0) select 3; _misMatch = false; _hoverPath = (_closest select 2); @@ -180,7 +179,15 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), ACE_player, (GVAR(selectedAction) select 0) select 6] call GVAR(selectedStatement); + + // Clear the conditions caches + ["clearConditionCaches", []] call EFUNC(common,localEvent); + + // Check the action conditions + _actionData = GVAR(selectedAction) select 0; + if ([_target, _player, _actionData select 6] call (_actionData select 4)) then { + [_target, _player, _actionData select 6] call (_actionData select 3); + }; }; }; };