Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] Re: (PR#10413) Sanitycheck messages changed, city coords n
Home

[Freeciv-Dev] Re: (PR#10413) Sanitycheck messages changed, city coords n

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: marko.lindqvist@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10413) Sanitycheck messages changed, city coords now map coords.
From: "Marko Lindqvist" <cazfi74@xxxxxxxxx>
Date: Thu, 6 Jul 2006 12:20:18 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=10413 >

Marko Lindqvist wrote:
> 
>   Checks inside city map iteration in sanitycheck.c:170-237 used to 
> write city coordinates to messages, now map coordinates are used instead.

  City center is special tile. Attached patch mentions if tile failing 
sanity checks is city center.


  - ML

diff -Nurd -X.diff_ignore freeciv/server/sanitycheck.c 
freeciv/server/sanitycheck.c
--- freeciv/server/sanitycheck.c        2006-07-06 22:03:24.093750000 +0300
+++ freeciv/server/sanitycheck.c        2006-07-06 22:08:52.578125000 +0300
@@ -240,56 +240,65 @@
       switch (get_worker_city(pcity, x, y)) {
       case C_TILE_EMPTY:
        if (ptile->worked) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "empty but worked by %s!",
                  pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "",
                  (ptile)->worked->name);
        }
        if (is_enemy_unit_tile(ptile, pplayer)) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "empty but occupied by an enemy unit!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        if (game.info.borders > 0 && owner && owner != pcity->owner) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "empty but in enemy territory!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        if (!city_can_work_tile(pcity, x, y)) {
          /* Complete check. */
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "empty but is unavailable!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        break;
       case C_TILE_WORKER:
        if ((ptile)->worked != pcity) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "worked but main map disagrees!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        if (is_enemy_unit_tile(ptile, pplayer)) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "worked but occupied by an enemy unit!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        if (game.info.borders > 0 && owner && owner != pcity->owner) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "worked but in enemy territory!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        if (!city_can_work_tile(pcity, x, y)) {
          /* Complete check. */
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "worked but is unavailable!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        break;
       case C_TILE_UNAVAILABLE:
        if (city_can_work_tile(pcity, x, y)) {
-         freelog(LOG_ERROR, "Tile at %s->%d,%d marked as "
+         freelog(LOG_ERROR, "Tile at %s->%d,%d%s marked as "
                  "unavailable but seems to be available!",
-                 pcity->name, TILE_XY(ptile));
+                 pcity->name, TILE_XY(ptile),
+                  is_city_center(x, y) ? " (city center)" : "");
        }
        break;
       }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#10413) Sanitycheck messages changed, city coords now map coords., Marko Lindqvist <=