任务单 #45948

Coast fuel units legally save themselves like planes

开放日期: 2022-10-22 14:07 最后更新: 2022-11-26 14:32

报告人:
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
2

Details

  1. In unittools.c::bool is_airunit_refuel_point(const struct tile *ptile,
  2. const struct player *pplayer,
  3. const struct unit *punit)

adding this block of code at line 1532:

  1. /* Coastal-fueled units refuel on safe ocean tiles */
  2. if (utype_has_flag(unit_type_get(punit), UTYF_COAST)
  3. && is_safe_ocean(&(wld.map), ptile)) {
  4. return TRUE;
  5. }

...will result in coast-refueled ships smartly returning to nearby coast if able, to avoid death. Currently they only look for city or native base and will die even 1 tile away from obvious shoreline.

Renaming the function to is_unit_refuel_point might be more accurate also. Cheers

任务单历史 (3/6 Histories)

2022-10-22 14:07 Updated by: lexxie9952
  • New Ticket "Coast fuel units legally save themselves like planes" created
2022-10-22 17:10 Updated by: cazfi
  • 里程碑 Update from (无) to 3.0.5 (关闭)
  • 组件 Update from (无) to Server
评论

While at it, should centralize that logic. This bug would never had existed if it would have been enough to change the refuel-point logic in one place.

2022-11-21 12:11 Updated by: cazfi
  • 属主 Update from (无) to cazfi
  • 处理结果 Update from to Accepted
评论

Patch completely untested at the moment.

2022-11-26 14:32 Updated by: cazfi
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed

编辑

Please login to add comment to this ticket » 登录名