待辦事項 #45982

worklist_item_postpone_req_vec does not use city tile in context

啟用日期: 2022-10-27 05:25 最後更新: 2022-11-22 22:41

回報者:
負責人:
類型:
狀態:
關閉
元件:
里程碑:
優先權:
5 - 中
嚴重程度:
5 - 中
處理結果:
修正
檔案:
2

細節

Noticed in #45907. The result is that tile-dependent requirements are treatened as "possibly true" and the message or the signal are not shown. The city, actually, submits its tile when it builds a unit or a building.

Ticket History (3/15 Histories)

2022-10-27 05:25 Updated by: ihnatus
  • New Ticket "worklist_item_postpone_req_vec does not use city tile in context" created
2022-10-27 06:49 Updated by: ihnatus
評語

Added a patch. Tested on master, possibly works with 3.1 (where you can't put tile-dependend reqs on units but can on buildings). Possibly, in 3.2 we should remove .unttype from can_city_build_unit_direct() check in city.c since we don't have any relevant reqs here that would sanely check it.

(Edited, 2022-10-27 06:50 Updated by: ihnatus)
2022-10-27 07:46 Updated by: ihnatus
2022-10-27 07:49 Updated by: ihnatus
評語

Can't test now but looking at the code v.3.0 also does not call callbacks or show messages for inability of build a building due to Local/(C)Adjacent tile reqs. Just it needs another patch.

2022-10-29 05:50 Updated by: cazfi
評語

Might still make it to 3.0.5. I created the "3.0.6" version definition just to place there some tickets that I already know that I won't work on during 3.0.5 cycle.

(Edited, 2022-10-29 05:50 Updated by: cazfi)
2022-10-30 14:09 Updated by: cazfi
  • 負責人 Update from (無) to ihnatus
2022-11-02 05:29 Updated by: ihnatus
2022-11-02 06:26 Updated by: ihnatus
評語

Hm, in 3.0 it won't postpone a building if !can_city_build_improvement_later(), and no adjacent terrain etc. is considered a "never in million years" blocker. Likely, fixing this logic may change how scripts work (that now get "never" reason insto "need_terrain" etc.) I'm in doubt should we do it...

Digging in, is_req_unchanging() is what blocks consideration for future here (and it still blocks it in 3.1+, by the way). This function and its dependents should be probably moved somewhere into AI code since they mean "things that AI does not know how to change" but occur in some non-AI-related cases like this one.

(Edited, 2022-11-02 06:58 Updated by: ihnatus)
2022-11-02 10:17 Updated by: cazfi
評語

Good findings.

For this ticket, I'm waiting your recommendations about target branches, and which are the final patches for those.

2022-11-02 17:51 Updated by: ihnatus
評語

Well, since can't build reasons is a documented part that is supposed to work, we should develop patches since 3.0.x Just it is going to be more complex than just supplying a tile in one place.

2022-11-09 02:47 Updated by: ihnatus
評語

3.0 pacth added, but it does few good without #46029 version.

2022-11-21 09:44 Updated by: cazfi
  • 負責人 Update from ihnatus to cazfi
  • 處理結果 Update from to Accepted
2022-11-22 22:41 Updated by: cazfi
  • 狀態 Update from 開啟 to 關閉
  • 處理結果 Update from Accepted to 修正

Attachment File List

編輯

Please login to add comment to this ticket » 登入