From 240046ceeeaf4ecfd52d3b6f8daf7c205ef7e33e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 2 Aug 2018 14:42:44 -0500 Subject: [PATCH] Medical Menu - Check cursorObject if cursorTarget is invalid (#6496) 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 89488c0d69..fcf2dbfd66 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};