From 74aec459212cc50047cd92ad42df3a21f6292fb1 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 19 Dec 2015 20:50:57 -0600 Subject: [PATCH] Fix medical menu not closing on range, litter dir - Medical Menu didn't close when target moved out of range - Litter was always created in the same direction --- addons/medical/functions/fnc_handleCreateLitter.sqf | 2 +- addons/medical_menu/functions/fnc_onMenuOpen.sqf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index 31e65218c2..f4d22e17b5 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -16,7 +16,7 @@ if(!hasInterface) exitWith { false }; -params ["_litterClass", "_position", "_unit"]; +params ["_litterClass", "_position", "_direction"]; private["_litterObject", "_maxLitterCount"]; //IGNORE_PRIVATE_WARNING(_values); diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 2b47312453..b2a6970a78 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -77,11 +77,11 @@ GVAR(MenuPFHID) = [{ [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); //Check that it's valid to stay open: - if !(([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + if !(([ACE_player, GVAR(INTERACTION_TARGET), ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call FUNC(canOpenMenu)}) then { closeDialog 314412; //If we failed because of distance check, show UI message: if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then { - ["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + ["displayTextStructured", [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 2, ACE_player]] call EFUNC(common,localEvent); }; };