Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#4820) ground_unit_transporter_capacity
Home

[Freeciv-Dev] Re: (PR#4820) ground_unit_transporter_capacity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4820) ground_unit_transporter_capacity
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Mon, 11 Aug 2003 12:50:15 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 11 Aug 2003, Per I. Mathisen wrote:
> If you really want to find out: Load the savegame, then set all AIs to
> human. Then log in to each and look for units swimming in the ocean.
> Perhaps easier to find if you replace the assert in sanitycheck.c with a
> +die("Unit swimming in ocean at (%d, %d)", punit->x, punit->y);

Or like this:

Index: server/sanitycheck.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.c,v
retrieving revision 1.31
diff -u -r1.31 sanitycheck.c
--- server/sanitycheck.c        2003/08/01 15:58:08     1.31
+++ server/sanitycheck.c        2003/08/11 19:48:37
@@ -255,8 +255,10 @@
       pcity = map_get_city(x, y);
       if (pcity) {
        assert(pplayers_allied(city_owner(pcity), pplayer));
-      } else if (is_ocean(map_get_terrain(x, y))) {
-       assert(ground_unit_transporter_capacity(x, y, pplayer) >= 0);
+      } else if (is_ocean(map_get_terrain(x, y))
+          && ground_unit_transporter_capacity(x, y, pplayer) >= 0) {
+        die("%s's unit swimming in the ocean at (%d, %d)", pplayer->name,
+            x, y);
       }

sanitycheck.c really ought to have die() calls rather than asserts, since
asserts in there give you very little information.

  - Per




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