From 28929df32db20052bd0e86593ab6d60810fbf517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Wed, 11 Mar 2015 00:39:23 -0300 Subject: [PATCH] Avoid submenus running statements when they open. Instead just check if the hovering action should runOnHover --- addons/interact_menu/functions/fnc_render.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 58061a2b60..3930068c25 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -168,8 +168,10 @@ if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { GVAR(expanded) = true; GVAR(menuDepthPath) = +GVAR(lastPath); - // Execute the current action if it's opening a submenu - if (count (GVAR(selectedAction) select 1) > 0) then { + // Execute the current action if it's run on hover + private "_runOnHover"; + _runOnHover = ((GVAR(selectedAction) select 0) select 6) select 3; + if (_runOnHover) then { this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget);