Re: [Freeciv-Dev] (PR#34521) [Bug+Patch] Ghost cities for global observer

2007-01-25 Thread Daniel Markstedt

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

On 1/25/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
> 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
>
>

I had this problem a year ago and thought it was fixed.

See: http://bugs.freeciv.org/Ticket/Display.html?id=15261

 ~Daniel



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#34521) [Bug+Patch] Ghost cities for global observer

2007-01-25 Thread Marko Lindqvist

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.0 +0200
+++ freeciv/server/citytools.c	2007-01-25 13:14:50.0 +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