Fixed "Zone construction build wooden wall builds window instead. #32965" (rebased) #33673
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Zone construction build wooden wall builds window instead. #32965"
Purpose of change
Fixes #32965
Rebased from #33083
Describe the solution
Added recursive functions to handle complex constructions:
get_final_construction
detects what was really selected from the construction menu.Not just <First construction that contains "Build Wood Wall">,
but <The final construction is Wood Wall (t_wall, not t_wall_half)>.
find_base_construction
looks up the construction "tree" for the first building that we can actually construct here, and which will lead to our goal (may be indirectly).Now it is possible to have a zone "Build Wood Wall" over some chipped/broken wooden walls or empty windows. The result will be "wooden wall where possible".
EDIT:
Now blueprint construction is a continuous process. Once started it can be interrupted at any time (for ex., using
5
) and then continued.Partial (unfinished) construction in the blueprint zone will be continued.
Note, that there is no extra check that this specific construction will lead to the goal in blueprint. It is just assumed. I think it is safe enough, no?
Describe alternatives you've considered
Need some dependency structure in constructions (like a tree). For now just use logic like <"*_half" is not the final construction>.
Additional context
None