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
This commit is contained in:
PabstMirror 2015-12-19 20:50:57 -06:00
parent 4d041c3c94
commit 74aec45921
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@
if(!hasInterface) exitWith { false };
params ["_litterClass", "_position", "_unit"];
params ["_litterClass", "_position", "_direction"];
private["_litterObject", "_maxLitterCount"];
//IGNORE_PRIVATE_WARNING(_values);

View File

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