チケット #42666

Lua: API to unhardcode autoupgrade

登録: 2021-07-24 23:41 最終更新: 2022-02-10 07:55

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

詳細

This is a sub-task of #42659. Needed functions (test ones are probably common, edit ones are server scripting):

  • test if a unit may be converted (upgraded) to a given type regarding its current position, transporter and cargo;
  • get a unit type a player may upgrade a unit type to;
  • convert (upgrade) a unit to a given type (if it is possible; a double testing will likely occur in the loop but it's not fatal);
  • promote a unit given number of veteranship ranks (may be negative) clipped by its veteran system, no notifications sent; naturally accompanied by general veteranship getting functions;
  • an algorithm (in Lua or C) to get a random selection from a list.

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

2021-07-24 23:41 更新者: ihnatus
  • 新しいチケット "Lua: API to unhardcode autoupgrade" が作成されました
2022-02-06 06:44 更新者: ihnatus
コメント

Done. Based on a patch from #43778

2022-02-07 07:51 更新者: cazfi
コメント

default case from api_methods_unit_transform_problem() switch should be removed, and the assert placed after the block (all valid 'uu' values cause function to return from inside the switch). That way we get compiler warning in the future if there's a new 'enum unit_upgrade_result' added, but not handled in the switch.

2022-02-08 02:29 更新者: ihnatus
  • 添付ファイル 3_1-lua-api-upgrades2.patch (File ID: 8482) が付加されました
2022-02-08 02:29 更新者: ihnatus
コメント

Switch edited.

2022-02-08 04:03 更新者: ihnatus
  • 添付ファイル 3_1-lua-api-upgrades2.patch (File ID: 8482) が削除されました
2022-02-08 15:34 更新者: cazfi
コメント

Patch looks good to me (haven't tested it yet). The only concern is that is this future-proof (to not cause compatibility issues) concerning what ever way #43251 will get resolved.

2022-02-08 16:07 更新者: cazfi
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法なし から 受領 に更新されました
コメント

Git was complaining about a new trailing whitespace. Attached version with that fixed.

Reply To cazfi

The only concern is that is this future-proof (to not cause compatibility issues) concerning what ever way #43251 will get resolved.

Beginning review period regardless. People have 36h to comment, and that includes possibility to comment about #43251 compatibility.

2022-02-09 19:48 更新者: cazfi
コメント

Reply To cazfi

Git was complaining about a new trailing whitespace. Attached version with that fixed. Reply To cazfi

The only concern is that is this future-proof (to not cause compatibility issues) concerning what ever way #43251 will get resolved.

Beginning review period regardless. People have 36h to comment, and that includes possibility to comment about #43251 compatibility.

My own take is that after this goes in (and to a released datafile format), we just need to resolve #43251 in a way that retains compatibility. It can add stuff, but will have some limitations how it can rework existing functionality.

2022-02-10 07:55 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

添付ファイルリスト

編集

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