Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#6216) Assertion `punit->transported_by != -1' failed
Home

[Freeciv-Dev] (PR#6216) Assertion `punit->transported_by != -1' failed

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdwheeler42@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#6216) Assertion `punit->transported_by != -1' failed
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 21 Sep 2003 22:01:41 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Here is a quick-fix patch.  Unfortunately this just makes the current 
ugliness uglier.  Fixing the ugliness is harder and bug-prone: we have 
to update player unit lists, city supported unit lists, fog, contact, 
sentry wakeup, city tile status maps, and additional syncing with the 
client.

I wonder what other values aren't initialized in this transfer?

jason

Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.233
diff -u -r1.233 citytools.c
--- server/citytools.c  2003/09/20 19:24:54     1.233
+++ server/citytools.c  2003/09/22 05:43:53
@@ -568,6 +568,7 @@
 {
   struct player *from_player = unit_owner(punit);
   struct player *to_player = city_owner(tocity);
+  struct unit *punit2;
 
   if (from_player == to_player) {
     freelog(LOG_VERBOSE, "Changed homecity of %s's %s to %s",
@@ -599,9 +600,11 @@
     }
   }
 
-  (void) create_unit_full(to_player, punit->x, punit->y, punit->type,
-                         punit->veteran, tocity->id, punit->moves_left,
-                         punit->hp);
+  /* FIXME: gross hack */
+  punit2 = create_unit_full(to_player, punit->x, punit->y, punit->type,
+                           punit->veteran, tocity->id, punit->moves_left,
+                           punit->hp);
+  punit2->transported_by = punit->transported_by;
 }
 
 /*********************************************************************

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