Medical Menu - Check cursorObject if cursorTarget is invalid (#6496)

Should fix #6488
This commit is contained in:
PabstMirror 2018-08-02 14:42:44 -05:00 committed by GitHub
parent 6ae7c28025
commit 240046ceee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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};