Project

General

Profile

Bug #350 » 0019-Stop-sending-hidden-resources-to-the-client.patch

S3_1 - Marko Lindqvist, 03/24/2024 08:51 AM

View differences:

server/maphand.c
}
if (!pplayer || map_is_known_and_seen(ptile, pplayer, V_MAIN)) {
struct extra_type *resource;
info.known = TILE_KNOWN_SEEN;
info.continent = tile_continent(ptile);
owner = tile_owner(ptile);
......
info.terrain = (NULL != tile_terrain(ptile))
? terrain_number(tile_terrain(ptile))
: terrain_count();
info.resource = (NULL != tile_resource(ptile))
? extra_number(tile_resource(ptile))
: MAX_EXTRA_TYPES;
resource = tile_resource(ptile);
if (resource != NULL
&& (pplayer == NULL
|| player_knows_extra_exist(pplayer, resource, ptile))) {
info.resource = extra_number(resource);
} else {
info.resource = MAX_EXTRA_TYPES;
}
info.placing = (NULL != ptile->placing)
? extra_number(ptile->placing)
: -1;
......
if (!map_is_known_and_seen(ptile, pplayer, V_MAIN)) {
map_set_known(ptile, pplayer);
/* as the tile may be fogged send_tile_info won't always do this for us */
/* As the tile may be fogged send_tile_info won't always do this for us */
update_player_tile_knowledge(pplayer, ptile);
update_player_tile_last_seen(pplayer, ptile);
send_tile_info(pplayer->connections, ptile, FALSE);
/* remove old cities that exist no more */
/* Remove old cities that exist no more */
reality_check_city(pplayer, ptile);
if ((pcity = tile_city(ptile))) {
/* as the tile may be fogged send_city_info won't do this for us */
/* As the tile may be fogged send_city_info won't do this for us */
update_dumb_city(pplayer, pcity);
send_city_info(pplayer, pcity);
}
......
BV_CLR(plrtile->extras, extra_number(pextra));
}
} extra_type_iterate_end;
plrtile->resource = ptile->resource;
if (ptile->resource != NULL
&& player_knows_extra_exist(pplayer, ptile->resource, ptile)) {
plrtile->resource = ptile->resource;
} else {
plrtile->resource = NULL;
}
plrtile->owner = tile_owner(ptile);
plrtile->extras_owner = extra_owner(ptile);
(2-2/2)