[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]
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;
}
|
|