チケット #42600

Strict coast ships can't enter tiny island cities

登録: 2021-07-06 17:17 最終更新: 2021-09-29 00:37

報告者:
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
3

詳細

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

チケットの履歴 (11 件中 3 件表示)

2021-07-06 17:17 更新者: lexxie9952
  • 新しいチケット "Strict coast ships can't enter tiny island cities" が作成されました
2021-07-07 02:40 更新者: ihnatus
コメント

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 更新者: cazfi
コメント

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 更新者: cazfi
  • 解決法なし から 受領 に更新されました
  • マイルストーン(未割り当て) から 2.6.6 (完了済み) に更新されました
2021-09-22 06:05 更新者: cazfi
  • コンポーネント(未割り当て) から General に更新されました
2021-09-23 13:27 更新者: None
コメント

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 更新者: cazfi
コメント

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 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法受領 から 修正済み に更新されました

編集

このチケットにコメントを追加するには、ログインが必要です » ログインする