Author: sveinung
Date: Wed Jan 25 13:06:09 2017
New Revision: 34889
URL: http://svn.gna.org/viewcvs/freeciv?rev=34889&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/S3_0/server/citytools.c
Modified: branches/S3_0/server/citytools.c
URL:
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/server/citytools.c?rev=34889&r1=34888&r2=34889&view=diff
==============================================================================
--- branches/S3_0/server/citytools.c (original)
+++ branches/S3_0/server/citytools.c Wed Jan 25 13:06:09 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
[email protected]
https://mail.gna.org/listinfo/freeciv-commits