From 04c9b628c4d10b4945e62600fbca336634987b39 Mon Sep 17 00:00:00 2001 From: bux578 Date: Thu, 16 Jun 2016 17:36:37 +0200 Subject: [PATCH] exit the loop properly --- addons/minedetector/functions/fnc_getDetectedObject.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/minedetector/functions/fnc_getDetectedObject.sqf b/addons/minedetector/functions/fnc_getDetectedObject.sqf index 004de3d0f9..79c20964ca 100644 --- a/addons/minedetector/functions/fnc_getDetectedObject.sqf +++ b/addons/minedetector/functions/fnc_getDetectedObject.sqf @@ -54,6 +54,9 @@ private _distance = -1; _distance = _detectorPointAGL distance _x; }; }; + + if (!isNull _mine) exitWith {}; + } forEach _nearestObjects; TRACE_3("return",_isDetectable,_mine,_distance);