Author: pepeto
Date: Mon Jan 26 11:43:58 2015
New Revision: 27855

URL: http://svn.gna.org/viewcvs/freeciv?rev=27855&view=rev
Log:
Remove buoys from owner player knowledge when they get destroyed.

See gna bug #22863

Modified:
    branches/S2_5/server/maphand.c

Modified: branches/S2_5/server/maphand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/maphand.c?rev=27855&r1=27854&r2=27855&view=diff
==============================================================================
--- branches/S2_5/server/maphand.c      (original)
+++ branches/S2_5/server/maphand.c      Mon Jan 26 11:43:58 2015
@@ -2261,6 +2261,16 @@
 ****************************************************************************/
 void destroy_base(struct tile *ptile, struct base_type *pbase)
 {
+  bv_player base_seen;
+
+  /* Remember what play was able to see the base. */
+  BV_CLR_ALL(base_seen);
+  players_iterate(pplayer) {
+    if (map_is_known_and_seen(ptile, pplayer, V_MAIN)) {
+      BV_SET(base_seen, player_index(pplayer));
+    }
+  } players_iterate_end;
+
   if (territory_claiming_base(pbase)) {
     /* Clearing borders will take care of the vision providing
      * bases as well. */
@@ -2281,6 +2291,14 @@
     }
   }
   tile_remove_base(ptile, pbase);
+
+  /* Remove base from vision of players which were able to see the base. */
+  players_iterate(pplayer) {
+    if (BV_ISSET(base_seen, player_index(pplayer))
+        && update_player_tile_knowledge(pplayer, ptile)) {
+      send_tile_info(pplayer->connections, ptile, FALSE);
+    }
+  } players_iterate_end;
 }
 
 /****************************************************************************


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to