任务单 #44416

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

开放日期: 2022-04-18 19:49 最后更新: 2022-05-22 09:05

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
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.

任务单历史 (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
  • 里程碑 Update from (无) to 3.0.2 (关闭)
  • 组件 Update from (无) to Server
2022-05-08 12:25 Updated by: cazfi
  • 属主 Update from (无) to cazfi
  • 处理结果 Update from to Accepted
2022-05-22 09:05 Updated by: cazfi
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » 登录名