Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2005:
[Freeciv-Dev] (PR#14623) Observer madness
Home

[Freeciv-Dev] (PR#14623) Observer madness

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: himasaram@xxxxxxxx
Subject: [Freeciv-Dev] (PR#14623) Observer madness
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Nov 2005 23:44:42 -0800
Reply-to: bugs@xxxxxxxxxxx

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

> [dmarks - Thu Nov 17 06:42:49 2005]:
> 
> I was observing a huge 30-player AI game and came across some observer 
> weirdness: The view wasn't updated correctly and some units and cities 
> remained as mirages on the map. See shot no 1 for an example of two 
> cities in adjacent squares (illegal): Persian Susa and Viking Torsberg, 
> where Susa is on Viking terriory. I think many of the units are ghosts 
> too. Reloading autosaves hint that Susa was razed at some point and 
> Torsberg founded on the released territory (shot 2). These two shots 
> are about ten turns apart.

This patch should fix the ghost-units bugs.

-jason

Index: server/unittools.c
===================================================================
--- server/unittools.c  (revision 11238)
+++ server/unittools.c  (working copy)
@@ -1373,11 +1373,11 @@
     ai_unit_new_role(punit, AIUNIT_NONE, NULL);
   }
 
-  players_iterate(pplayer) {
-    if (can_player_see_unit(pplayer, punit)) {
-      dlsend_packet_unit_remove(pplayer->connections, punit->id);
+  conn_list_iterate(game.all_connections, pconn) {
+    if (!pconn->player || can_player_see_unit(pconn->player, punit)) {
+      dsend_packet_unit_remove(pconn, punit->id);
     }
-  } players_iterate_end;
+  } conn_list_iterate_end;
 
   vision_clear_sight(punit->server.vision);
   vision_free(punit->server.vision);

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