Quantcast

Bug #447: hbd:GetZoneDistance() may return nil

Ludovicus [06-24-19 - 23:29]
Bug #447: hbd:GetZoneDistance() may return nil
Filename
TomTom_POIIntegration.lua
diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua
index 94ce985..09bfcd5 100755
--- a/TomTom_POIIntegration.lua
+++ b/TomTom_POIIntegration.lua
@@ -81,7 +81,7 @@ local function ObjectivesChanged()

         if x and y then
             local dist = hbd:GetZoneDistance(map, px, py, map, x, y)
-            if dist < closestdist then
+            if dist and (dist < closestdist) then
                 closest = watchIndex
                 closestdist = dist
             end