Tíquete #45982

worklist_item_postpone_req_vec does not use city tile in context

: 2022-10-27 05:25 Última Atualização: 2022-11-22 22:41

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Marcos:
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
2

Details

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
Comentário

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:49 Updated by: ihnatus
Comentário

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
Comentário

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
  • Dono Update from (Nenhum) to ihnatus
2022-11-02 05:29 Updated by: ihnatus
2022-11-02 06:26 Updated by: ihnatus
Comentário

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
Comentário

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
Comentário

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
Comentário

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

2022-11-21 09:44 Updated by: cazfi
  • Dono Update from ihnatus to cazfi
  • Resolução Update from Nenhum to Accepted
2022-11-22 22:41 Updated by: cazfi
  • Estado Update from Aberto to Fechado
  • Resolução Update from Accepted to Fixed

Attachment File List

Editar

Please login to add comment to this ticket » Login