Tíquete #45948

Coast fuel units legally save themselves like planes

: 2022-10-22 14:07 Última Atualização: 2022-11-26 14:32

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
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
  • Marco Update from (Nenhum) to 3.0.5 (fechado)
  • Componente Update from (Nenhum) to Server
Comentário

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
  • Dono Update from (Nenhum) to cazfi
  • Resolução Update from Nenhum to Accepted
Comentário

Patch completely untested at the moment.

2022-11-26 14:32 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