Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2003:
[Freeciv-Dev] Re: (PR#4259) Re: Re: (PR#4338) cm4 sanitycheck
Home

[Freeciv-Dev] Re: (PR#4259) Re: Re: (PR#4338) cm4 sanitycheck

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx, rf13@xxxxxxxxxxxxxxxxx, ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4259) Re: Re: (PR#4338) cm4 sanitycheck
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Mon, 2 Jun 2003 08:46:52 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, 1 Jun 2003, ChrisK@xxxxxxxx wrote:
> This gives another assert, when moving in the city:
>
> civserver: unittype.c:86: get_unit_type: Zusicherung »id >= 0 && id < 200 &&
> id < game.num_unit_types« nicht erfüllt.

Right. Try this instead. Patch attached. It works with the savegame you
sent earlier.

As I said before, this patch changes behaviour slightly when Civil War and
other mass city transfers take place - several transported units might
needlessly die at sea. But a small price to pay to make cvs stable again,
I guess.

  - Per

Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.218
diff -u -r1.218 citytools.c
--- server/citytools.c  6 May 2003 05:06:07 -0000       1.218
+++ server/citytools.c  2 Jun 2003 15:39:35 -0000
@@ -656,7 +656,7 @@
 
   /* Any remaining units supported by the city are either given new home
      cities or maybe destroyed */
-  unit_list_iterate(*units, vunit) {
+  unit_list_iterate_safe(*units, vunit) {
     struct city *new_home_city = map_get_city(vunit->x, vunit->y);
     if (new_home_city && new_home_city != exclude_city) {
       /* unit is in another city: make that the new homecity,
@@ -672,8 +672,8 @@
        no cargo deletion => no trouble with "units" list.
        In cases where the cargo can be left without transport the calling
        function should take that into account. */
-    wipe_unit_spec_safe(vunit, NULL, FALSE);
-  } unit_list_iterate_end;
+    wipe_unit(vunit);
+  } unit_list_iterate_safe_end;
 }
 
 /**********************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#4259) Re: Re: (PR#4338) cm4 sanitycheck, Per I. Mathisen <=