Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#9540) GHOST UNITS again!
Home

[Freeciv-Dev] Re: (PR#9540) GHOST UNITS again!

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9540) GHOST UNITS again!
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 2 Aug 2004 03:08:41 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9540 >

This patch is better. Units which wouldn't be seen anyway because of  
fog of war aren't removed.

--
mateusz


----------------------------------------------------------------------
To moze byc ekscytujace lato... >>> http://link.interia.pl/f181c

Index: unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.295
diff -u -r1.295 unittools.c
--- unittools.c 30 Jul 2004 18:35:03 -0000      1.295
+++ unittools.c 2 Aug 2004 09:22:12 -0000
@@ -2796,6 +2796,19 @@
       unit_goes_out_of_sight(pplayer, punit);
     }
   } players_iterate_end;
+  
+  /* Remove all hidden units which aren't seen anymore.  */
+  square_iterate(src_x, src_y, 1, n_x, n_y) {
+    players_iterate(pplayer) {
+      if (map_get_known(n_x, n_y, pplayer) == TILE_KNOWN) {
+        unit_list_iterate(map_get_tile(n_x, n_y)->units, punit2) {
+          if (punit2 != punit && !can_player_see_unit(pplayer, punit2)) {
+           unit_goes_out_of_sight(pplayer, punit2);
+         }
+        } unit_list_iterate_end;
+      }
+    } players_iterate_end;
+  } square_iterate_end;
 
   handle_unit_move_consequences(punit, src_x, src_y, dest_x, dest_y);
   wakeup_neighbor_sentries(punit);



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9540) GHOST UNITS again!, Mateusz Stefek <=