Author: sveinung
Date: Wed Jan 25 13:05:45 2017
New Revision: 34888

URL: http://svn.gna.org/viewcvs/freeciv?rev=34888&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:
    trunk/server/citytools.c

Modified: trunk/server/citytools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/citytools.c?rev=34888&r1=34887&r2=34888&view=diff
==============================================================================
--- trunk/server/citytools.c    (original)
+++ trunk/server/citytools.c    Wed Jan 25 13:05:45 2017
@@ -2020,22 +2020,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_partners_iterate(pcity, other) {
-    if (city_owner(other) == pplayer) {
-      return TRUE;
-    }
-  } trade_partners_iterate_end;
-
-  return FALSE;
-}
-
-/**************************************************************************
  Which wall gfx city should display?
 **************************************************************************/
 static int city_got_citywalls(const struct city *pcity)
@@ -2090,8 +2074,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;
 
@@ -2138,8 +2121,7 @@
         } traderoute_packet_list_iterate_end;
       }
     } 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