Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] Re: (PR#6189) stacked with ai at start
Home

[Freeciv-Dev] Re: (PR#6189) stacked with ai at start

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ggracian@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6189) stacked with ai at start
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Sep 2003 15:11:51 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:

> The attached patch gives stricter sanity checking for stacked units.


? core.10012
Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.23
diff -u -r1.23 sanitycheck.c
--- server/sanitycheck.c        2002/09/11 17:04:43     1.23
+++ server/sanitycheck.c        2003/09/18 22:50:34
@@ -112,6 +112,14 @@
 
     unit_list_iterate(ptile->units, punit) {
       assert(same_pos(punit->x, punit->y, x, y));
+
+      /* Check diplomatic status of stacked units. */
+      unit_list_iterate(ptile->units, punit2) {
+       assert(pplayers_allied(unit_owner(punit), unit_owner(punit2)));
+      } unit_list_iterate_end;
+      if (pcity) {
+       assert(pplayers_allied(unit_owner(punit), city_owner(pcity)));
+      }
     } unit_list_iterate_end;
   } whole_map_iterate_end;
 }

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