changeset 2105:7da1e8aa541b

Oops, fix distance calculation coordinate adjustments.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 10 Sep 2019 16:47:44 +0300
parents 425e8a4d2530
children e7ab4a64a988
files mapsearch.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mapsearch.c	Tue Sep 10 16:41:19 2019 +0300
+++ b/mapsearch.c	Tue Sep 10 16:47:44 2019 +0300
@@ -1200,8 +1200,8 @@
     for (int nloc = 0; nloc < optNMapLocations; nloc++)
     {
         LocMarker *marker = optMapLocations[nloc];
-        int dx = xc - (marker->xc + marker->file->xoffs),
-            dy = yc - (marker->yc + marker->file->yoffs),
+        int dx = xc - (optWorldXC + marker->xc + marker->file->xoffs),
+            dy = yc - (optWorldYC + marker->yc + marker->file->yoffs),
             dist = sqrt(dx * dx + dy * dy);
 
         if (maxDist < 0 || dist <= maxDist)