Tíquete #44416

Number of units reported killed is wrong when unreachable units were on the tile.

: 2022-04-18 19:49 Última Atualização: 2022-05-22 09:05

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

Details

this bug is in unittools.c line 2283: https://github.com/freeciv/freeciv/blob/c638e472ea3e99c08e22caf7e6abae89649618ee/server/unittools.c#L2283

The solution to this bug is easy. Everywhere else we check TWO conditions, e.g. line 2313

if (pplayers_at_war(pvictor, vplayer)
&& is_unit_reachable_at(vunit, pkiller, deftile))

But on line 2283 we only check if pplayers_at_war and not if the unit is reachable. Not surprisingly then, any unreachable units on the tile get counted as killed when it is reported "You killed the whatever and x other units". x is wrongly inflated by exactly how many unreachable units were on that tile.

Ticket History (3/5 Histories)

2022-04-18 19:49 Updated by: lexxie9952
  • New Ticket "Number of units reported killed is wrong when unreachable units were on the tile." created
2022-05-04 13:06 Updated by: cazfi
  • Marco Update from (Nenhum) to 3.0.2 (fechado)
  • Componente Update from (Nenhum) to Server
2022-05-08 12:25 Updated by: cazfi
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Nenhum to Accepted
2022-05-22 09:05 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Login