#1856 - Close huntIR monitor if item removed

This commit is contained in:
PabstMirror 2015-07-16 19:12:11 -05:00
parent 04e137090b
commit b6e124d340
2 changed files with 10 additions and 0 deletions

View File

@ -63,6 +63,11 @@ GVAR(no_cams) sort true;
GVAR(no_cams) set [_forEachIndex, _x select 1];
} forEach GVAR(no_cams);
[{
//Close monitor if we no longer have the item:
if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then {
closeDialog 0;
};
GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
{
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then {

View File

@ -38,6 +38,11 @@ createDialog "ace_huntir_cam_dialog_off";
GVAR(messageSearching) = toArray "Searching.....";
GVAR(messageConnecting) = toArray "Connecting.....";
[{
//Close monitor if we no longer have item:
if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then {
closeDialog 0;
};
private ["_elapsedTime", "_nearestHuntIRs"];
_elapsedTime = ACE_time - GVAR(startTime);
_nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];