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

2008/5/12 guest user <Freeciv>:
>
> This assertion still happens to fail with the new 2.1.4 Version
> (gui-gtk-2.0).
> With logging level 2, the logfile will contain only one line:
>
> 1: 0xdbbed78 324 Mech. Inf. at (21,48) Qianlong
>
> Since I can reliably reproduce it, I'm reporting it here.

 Thanks for the report.

 Reason for this one was unit losing visibility of itself when
transferred from old player to new rebel player. Sending of
remove_unit to client before fogging was optimized out on the basis
that player will get later info about lost unit anyway (which was not
even true in this case).

 Fix attached.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/unittools.c freeciv/server/unittools.c
--- freeciv/server/unittools.c	2008-04-23 03:13:19.000000000 +0300
+++ freeciv/server/unittools.c	2008-05-16 04:55:20.000000000 +0300
@@ -1799,11 +1799,15 @@
 **************************************************************************/
 void unit_goes_out_of_sight(struct player *pplayer, struct unit *punit)
 {
-  struct packet_unit_short_info packet;
-
   if (unit_owner(punit) == pplayer) {
-    /* The unit is about to die. No need to send an info. */
+    /* Unit is either about to die, or to change owner (civil war, bribe) */
+    struct packet_unit_remove packet;
+
+    packet.unit_id = punit->id;
+    lsend_packet_unit_remove(pplayer->connections, &packet);
   } else {
+    struct packet_unit_short_info packet;
+
     memset(&packet, 0, sizeof(packet));
     packet.id = punit->id;
     packet.goes_out_of_sight = TRUE;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to