Skip to content

Commit

Permalink
Medical Menu - Check cursorObject if cursorTarget is invalid (#6496)
Browse files Browse the repository at this point in the history
Should fix #6488
  • Loading branch information
PabstMirror authored Aug 2, 2018
1 parent 6ae7c28 commit 240046c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/medical_menu/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 240046c

Please sign in to comment.