Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8726) handling fog-of-war errors at the client
Home

[Freeciv-Dev] (PR#8726) handling fog-of-war errors at the client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8726) handling fog-of-war errors at the client
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 May 2004 15:10:19 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8726 >

If there's a fog-of-war error and a tile that the client *think* has a 
unit on it is fogged, the tile triggers an assertion and prints some 
error messages.

1.  These should be LOG_ERROR not LOG_NORMAL.

2.  If we're compiling with NDEBUG we should handle the error by 
removing the phantom units.

This patch does both.

jason

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.363
diff -u -r1.363 packhand.c
--- client/packhand.c   28 Apr 2004 00:54:24 -0000      1.363
+++ client/packhand.c   12 May 2004 22:06:47 -0000
@@ -1973,11 +1973,12 @@
 
   if (ptile->known <= TILE_KNOWN_FOGGED && old_known == TILE_KNOWN) {
     unit_list_iterate(ptile->units, punit) {
-      freelog(LOG_NORMAL, "%p %s at (%d,%d) %s", punit,
+      freelog(LOG_ERROR, "%p %s at (%d,%d) %s", punit,
              unit_type(punit)->name, punit->x, punit->y,
              unit_owner(punit)->name);
     } unit_list_iterate_end;
     assert(unit_list_size(&ptile->units) == 0);
+    unit_list_unlink_all(&ptile->units);
   }
 
   /* update continents */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8726) handling fog-of-war errors at the client, Jason Short <=