Incidencia #42600

Strict coast ships can't enter tiny island cities

Abrir Fecha: 2021-07-06 17:17 Última actualización: 2021-09-29 00:37

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
3

Details

Photo of a boat unit who is unable to enter a tiny island city. https://cdn.discordapp.com/attachments/358555060382203905/861719109272207380/unknown.png

blamed: map.c:is_safe_ocean() and/or the conditional logic in the 3 places in movement.c which include is_safe_ocean in a conditional logic expression

Ticket History (3/11 Histories)

2021-07-06 17:17 Updated by: lexxie9952
  • New Ticket "Strict coast ships can't enter tiny island cities" created
2021-07-07 02:40 Updated by: ihnatus
Comentario

Yes, there is an omission dating back to long ago ("Trireme" flag in 2.6, "CoastStrict" later) that a coast strict unit tests adjacent tiles for being a safe coast but not its own one, so on a one-tile safe coast region it is illegal even if the terrain is safe coast itself and/or city. Even if we test the unit's tile for safe coast, btw, such a unit won't be able to exist in an oceanic city not adjacent to a safe coast, even if it is able to exist on adjacent tiles; that looks like also a bug.

2021-09-22 05:53 Updated by: cazfi
Comentario

Reply To ihnatus

Even if we test the unit's tile for safe coast, btw, such a unit won't be able to exist in an oceanic city not adjacent to a safe coast, even if it is able to exist on adjacent tiles; that looks like also a bug.

Reading the code, I don't see the same problem with these as with moving to a tile. Related functions check for a safe city's existence *before* considering if unit is a CoastStrict unit outside safe coast.

2021-09-22 06:04 Updated by: cazfi
  • Resolución Update from Ninguno to Accepted
  • Hito Update from (Ninguno) to 2.6.6 (cerrado)
2021-09-22 06:05 Updated by: cazfi
  • Componente Update from (Ninguno) to General
2021-09-23 13:27 Updated by: None
Comentario

Wow that was easy. Thanks.

I was checking around and found this in movement.c, bool can_exist_at_tile(...) ...

/* UTYF_COAST_STRICT unit cannot exist in an ocean tile without access to land. */ if (utype_has_flag(utype, UTYF_COAST_STRICT)
&& !is_safe_ocean(nmap, ptile)) {
return FALSE;
}

Maybe a dumb question but would this also need a "&& !pcity" condition in there too?

2021-09-25 10:03 Updated by: cazfi
Comentario

Reply To (Anonymous)

Wow that was easy. Thanks. I was checking around and found this in movement.c, bool can_exist_at_tile(...) ... /* UTYF_COAST_STRICT unit cannot exist in an ocean tile without access to land. */ if (utype_has_flag(utype, UTYF_COAST_STRICT) && !is_safe_ocean(nmap, ptile)) { return FALSE; } Maybe a dumb question but would this also need a "&& !pcity" condition in there too?

I think that if there's a relevant city, the function has returned already, and execution never even reach that code.
2021-09-29 00:37 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Accepted to Fixed

Editar

Please login to add comment to this ticket » Entrar