Ticket #45948

Coast fuel units legally save themselves like planes

오픈 날짜: 2022-10-22 14:07 마지막 업데이트: 2022-11-26 14:32

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
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

Ticket History (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
  • Milestone Update from (None) to 3.0.5 (closed)
  • Component Update from (None) 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 (None) to cazfi
  • Resolution Update from None to Accepted
댓글 올리기

Patch completely untested at the moment.

2022-11-26 14:32 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login