From f078f96ddf2f6de93f4f42ef15669136e0832b55 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 2 Aug 2018 12:18:07 -0500 Subject: [PATCH] Medical Menu - Check cursorObject if cursorTarget is invalid Should fix #6488 --- addons/medical_menu/XEH_postInit.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf index 89488c0d695..fcf2dbfd667 100644 --- a/addons/medical_menu/XEH_postInit.sqf +++ b/addons/medical_menu/XEH_postInit.sqf @@ -17,8 +17,12 @@ GVAR(pendingReopen) = false; ["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey), { + TRACE_3("keyDown",cursorTarget,cursorObject,ACE_player); private _target = cursorTarget; - if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then {_target = ACE_player}; + if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then { + _target = cursorObject; + if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then { _target = ACE_player; }; + }; // Conditions: canInteract if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};