Tíquete #42967

send_city_info_at_tile() not revealing a city if the tile *is* known beforehand

: 2021-10-02 15:13 Última Atualização: 2021-11-10 20:59

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
1

Details

I'm debugging a problem in a rather old codebase, so this might not be accurate for HEAD. I just want to this written down until I have an opportunity to go through what's the situation in HEAD.

send_city_info_at_tile() for player other than city's owner checks if the tile is previously known, and it calls map_show_tile() if not. After that it updates information only if map_is_known_and_seen(). This means that there is no updates when map has been seen in the past (is known), but not at the moment. Meaning that player gets *less* information if s/he knows the tile, than if not.

The problem I'm debugging is that establishing foreign trade route should reveal the source city to the owner of the destination city. In the failing case owner of the destination city has before seen the tile where the source city is later established. send_city_info_at_tile() behavior causes the city not to get revealed. This then lead to client crash when trade partner was NULL there.

Ticket History (3/5 Histories)

2021-10-02 15:13 Updated by: cazfi
  • New Ticket "send_city_info_at_tile() not revealing a city if the tile *is* known beforehand" created
2021-10-11 22:36 Updated by: cazfi
Comentário

To make the send_city_info_at_tile() clean and consistent, we should stop it from *ever* revealing the tile. So it would send only what player is already marked to know. Callers that rely on revealing the tile should do it themselves, like trade route establishment does after fix #42968. I don't know if there's other such callers.

2021-10-12 01:46 Updated by: cazfi
  • Resolução Update from Nenhum to Accepted
  • Marco Update from (Nenhum) to 3.1.0 (fechado)
Comentário

Targeting to S3_1+ only as there's relatively high risk of breaking some caller that relies on old behavior.

2021-11-10 20:59 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login