Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#6200) disbanding a transporter must move its cargo
Home

[Freeciv-Dev] (PR#6200) disbanding a transporter must move its cargo

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6200) disbanding a transporter must move its cargo
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Sep 2003 07:46:47 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Currently when a transporter is disbanded, wipe_unit_spec_safe() checks 
the transporter capacity and destroys/bounces any units that won't fit 
anymore.  But it doesn't move the units that do fit from one transporter 
to another.

The attached patch adds an assertion that catches this.

jason

Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.251
diff -u -r1.251 unittools.c
--- server/unittools.c  2003/09/19 14:14:45     1.251
+++ server/unittools.c  2003/09/19 14:45:16
@@ -1563,6 +1563,12 @@
   struct city *phomecity = find_city_by_id(punit->homecity);
   int punit_x = punit->x, punit_y = punit->y;
 
+#ifndef NDEBUG
+  unit_list_iterate(map_get_tile(punit->x, punit->y)->units, pcargo) {
+    assert(pcargo->transported_by != punit->id);
+  } unit_list_iterate_end;
+#endif
+
   /* Since settlers plot in new cities in the minimap before they
      are built, so that no two settlers head towards the same city
      spot, we need to ensure this reservation is cleared should

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