チケット #48964

Units with (moves_left < 1) can't EMBARK in some rulesets

登録: 2024-01-18 01:13 最終更新: 2024-01-18 02:14

報告者:
担当者:
(未割り当て)
チケットの種類:
状況:
オープン
コンポーネント:
(未割り当て)
マイルストーン:
(未割り当て)
優先度:
5 - 中
重要度:
5 - 中
解決法:
なし
ファイル:
なし

詳細

(Please disregard if upstream has made major recent changes to how TRANSPORT_EMBARK is executed, and accept my apologies.)

To recreate the issue, set a req that ACTION_TRANSPORT_BOARD requires the unit to have moves_left, then take a unit with <1 moves_left and embark to adjacent tile.

If land unit embarking to water, it will move to the water tile but then be unable to embark because ACTION_TRANSPORT_EMBARK is a pseudo-action that really does a dual action of order_move then order_board. So it will be left drowning in the water. But in all cases it will move to the tile but then not board.

The bugged code also assumed order_board will always be legal on the transport's tile in all cases where embark was legal from the adjacent tile (conceivably not the case in some theoretic rulesets.) Theoretic ruleset example: you need to be on a special space-dock infra tile to embark on a spaceship, but the spaceship is only pulled along-side this orbital docking satellite.)

At FCW, transport embark ultimately calls unit_move with emark_to punit pointer parameter, then ultimately arrives at a line of code like if (ptransporter) {

unit_transport_load_tp_status(punit, ptransporter, FALSE);

Changing FALSE to TRUE changes the bool parameter 'force' to enact the boarding no matter what, and this fixed the bug for us at FCW. To me this made sense because once the unit moves to the transport's tile, it represents a "promise" that is executing the order TRANSPORT_EMBARK which was already legally represented to the user as a valid action they could do with the DO-click-tile popup menu.

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

2024-01-18 01:13 更新者: lexxie9952
  • 新しいチケット "Units with (moves_left < 1) can't EMBARK in some rulesets" が作成されました
2024-01-18 02:14 更新者: cazfi
コメント

As already discussed in https://forum.freeciv.org/f/viewtopic.php?t=94686, it's not an "dual action", nor can I reproduce the issue (with current freeciv)

添付ファイルリスト

添付ファイルはありません

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする