Author: sveinung
Date: Wed Jan 25 13:06:48 2017
New Revision: 34890

URL: http://svn.gna.org/viewcvs/freeciv?rev=34890&view=rev
Log:
Control city externals sending centrally.

The function player_can_see_city_externals() is used to reason about what a
player can see. Use it to control when a city's externally visible details
is sent too.

See patch #8082

Modified:
    branches/S2_6/server/citytools.c

Modified: branches/S2_6/server/citytools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/citytools.c?rev=34890&r1=34889&r2=34890&view=diff
==============================================================================
--- branches/S2_6/server/citytools.c    (original)
+++ branches/S2_6/server/citytools.c    Wed Jan 25 13:06:48 2017
@@ -1995,22 +1995,6 @@
 }
 
 /**************************************************************************
-  Returns true if the player owns a city which has a trade route with
-  the given city.
-**************************************************************************/
-static bool player_has_trade_route_with_city(struct player *pplayer,
-                                             struct city *pcity)
-{
-  trade_routes_iterate(pcity, other) {
-    if (city_owner(other) == pplayer) {
-      return TRUE;
-    }
-  } trade_routes_iterate_end;
-
-  return FALSE;
-}
-
-/**************************************************************************
  Which wall gfx city should display?
 **************************************************************************/
 static int city_got_citywalls(const struct city *pcity)
@@ -2065,8 +2049,7 @@
 void refresh_dumb_city(struct city *pcity)
 {
   players_iterate(pplayer) {
-    if (map_is_known_and_seen(pcity->tile, pplayer, V_MAIN)
-        || player_has_trade_route_with_city(pplayer, pcity)) {
+    if (player_can_see_city_externals(pplayer, pcity)) {
       if (update_dumb_city(pplayer, pcity)) {
        struct packet_city_short_info packet;
 
@@ -2107,8 +2090,7 @@
         lsend_packet_city_info(powner->connections, &packet, FALSE);
       }
     } else {
-      if (map_is_known_and_seen(pcity->tile, pplayer, V_MAIN)
-          || player_has_trade_route_with_city(pplayer, pcity)) {
+      if (player_can_see_city_externals(pplayer, pcity)) {
         reality_check_city(pplayer, pcity->tile);
        update_dumb_city(pplayer, pcity);
        package_dumb_city(pplayer, pcity->tile, &sc_pack);


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

Reply via email to