Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] Re: (PR#18281) assert find_city_from_small_wonder == NULL
Home

[Freeciv-Dev] Re: (PR#18281) assert find_city_from_small_wonder == NULL

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#18281) assert find_city_from_small_wonder == NULL
From: "Marko Lindqvist" <cazfi74@xxxxxxxxx>
Date: Sat, 8 Jul 2006 18:37:59 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Marko Lindqvist wrote:
> 
> assertion "find_city_from_small_wonder(pplayer, id) == NULL" failed: 
> file "../../freeciv-patch/server/citytools.c", line 721

  Attached sanitycheck goes crazy from the very beginning. When I change 
it so that I compare return value of find_city_from_small_wonder() to 
NULL, it takes some time before first error message is printed. My guess 
  is that initial capital is not properly inserted to small_wonders array.
  Once actual bug is fixed, this sanitycheck should go in too.


  - ML

diff -Nurd -X.diff_ignore freeciv/server/sanitycheck.c 
freeciv/server/sanitycheck.c
--- freeciv/server/sanitycheck.c        2006-07-09 04:11:56.296875000 +0300
+++ freeciv/server/sanitycheck.c        2006-07-09 04:20:05.734375000 +0300
@@ -229,6 +229,14 @@
     SANITY_CITY(pcity, unit_owner(punit) == pplayer);
   } unit_list_iterate_end;
 
+  built_impr_iterate(pcity, id) {
+    if (is_small_wonder(id)) {
+      SANITY_CITY(pcity, find_city_from_small_wonder(pplayer, id) == pcity);
+    } else if (is_great_wonder(id)) {
+      SANITY_CITY(pcity, find_city_from_great_wonder(id) == pcity);
+    }
+  } built_impr_iterate_end;
+
   /* Note that cities may be found on land or water. */
 
   city_map_iterate(x, y) {

[Prev in Thread] Current Thread [Next in Thread]