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

 Destroyed cities are not removed for global observer. I have to leave
the game and reconnect in order to see if some city really exist.

 City id to be sent for global observer is got from city structure
after it is freed. Fix for that attached. It might resolve the ghost
city problem.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/citytools.c freeciv/server/citytools.c
--- freeciv/server/citytools.c	2007-01-22 17:18:36.000000000 +0200
+++ freeciv/server/citytools.c	2007-01-25 13:14:50.000000000 +0200
@@ -1054,6 +1054,7 @@
   bv_imprs had_small_wonders;
   char *city_name = mystrdup(pcity->name);
   struct vision *old_vision;
+  int id = pcity->id; /* We need this even after memory has been freed */
 
   BV_CLR_ALL(had_small_wonders);
   built_impr_iterate(pcity, i) {
@@ -1153,7 +1154,7 @@
       /* For detached observers we have to send a specific packet.  This is
        * a hack necessitated by the private map that exists for players but
        * not observers. */
-      dsend_packet_city_remove(pconn, pcity->id);
+      dsend_packet_city_remove(pconn, id);
     }
   } conn_list_iterate_end;
 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to