changeset 1941:97ff235f42f5

Send center coordinates separately in the results.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 13 Nov 2017 06:40:52 +0200
parents 30fc1fa3dce7
children 0acfd2f06ebb
files mapsearch.c
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mapsearch.c	Mon Nov 13 06:29:20 2017 +0200
+++ b/mapsearch.c	Mon Nov 13 06:40:52 2017 +0200
@@ -75,7 +75,7 @@
 {
     BOOL type;
     char *map, *loc1, *loc2;
-    int mx, my, wx, wy;
+    int mx, my, wx, wy, cx,  cy;
     BOOL centered;
 } MAPMatch;
 
@@ -864,11 +864,12 @@
         if (match->type)
         {
             vstr = th_strdup_printf(
-                "[%d,\"%s\",%d,%d,%d,%d]%s",
-                match->centered,
+                "[\"%s\",%d,%d,%d,%d,%d,%d,%d]%s",
                 match->map,
                 match->mx, match->my,
                 match->wx, match->wy,
+                match->centered,
+                match->cx, match->cy,
                 (n < nmatches - 1) ? "," : "");
         }
         else
@@ -1070,10 +1071,12 @@
 
                 match->type = TRUE;
                 match->map = info->locFile.continent;
-                match->mx = ox + centerX + 1;
-                match->my = oy + centerY + 1;
-                match->wx = optWorldXC + info->locFile.x + ox + centerX;
-                match->wy = optWorldYC + info->locFile.y + oy + centerY;
+                match->mx = ox + 1;
+                match->my = oy + 1;
+                match->wx = optWorldXC + info->locFile.x + ox;
+                match->wy = optWorldYC + info->locFile.y + oy;
+                match->cx = centerX;
+                match->cy = centerY;
                 match->centered = centerFound;
 
                 // Check for max matches