Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2005:
[Freeciv-Dev] Re: (PR#14473) civserver segfault
Home

[Freeciv-Dev] Re: (PR#14473) civserver segfault

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#14473) civserver segfault
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Tue, 1 Nov 2005 03:36:53 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14473 >

Here's a patch
--
mateusz

Index: server/unithand.c
===================================================================
--- server/unithand.c   (wersja 11206)
+++ server/unithand.c   (kopia robocza)
@@ -277,15 +277,6 @@
   struct player *old_owner = unit_owner(punit);
   struct player *new_owner = city_owner(new_pcity);
 
-  if (!same_pos(punit->tile, new_pcity->tile)) {
-    assert(can_unit_exist_at_tile(punit, new_pcity->tile));
-    move_unit(punit, new_pcity->tile, 0); /* teleport to location */
-  }
-
-  unit_list_prepend(new_pcity->units_supported, punit);
-  if (old_pcity) {
-    unit_list_unlink(old_pcity->units_supported, punit);
-  }
   if (old_owner != new_owner) {
     vision_clear_sight(punit->server.vision);
     vision_free(punit->server.vision);
@@ -300,6 +291,16 @@
     unit_refresh_vision(punit);
   }
 
+  if (!same_pos(punit->tile, new_pcity->tile)) {
+    assert(can_unit_exist_at_tile(punit, new_pcity->tile));
+    move_unit(punit, new_pcity->tile, 0); /* teleport to location */
+  }
+  
+  unit_list_prepend(new_pcity->units_supported, punit);
+  if (old_pcity) {
+    unit_list_unlink(old_pcity->units_supported, punit);
+  }
+
   punit->homecity = new_pcity->id;
   send_unit_info(unit_owner(punit), punit);
 


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#14473) civserver segfault, Mateusz Stefek <=