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
Bugfixes "Perform mapgen in a more correct order"
Purpose of change
A while back I updated mapgen to proceed in phases. This is needed to prevent certain sorts of issues like bashing being done before terrain or furniture is placed, leading to furniture on
t_open_air
tiles or rubble on otherwise-undamaged tiles.However, we have two sorts of mapgen;
object
-based andsetmap_points
-based. Previously I had only fixed the former. Thesetmap_points
mapgen all happened first and was usually used for bashing, leading to the above sorts of issues.Describe the solution
Add phases to
setmap_points
mapgen also, and interleave the two types of mapgen phase-by-phase so that everything happens in the proper order.I also took the opportunity to remove some code duplication since three different parts of the code were performing similar mapgen of the two types.
Describe alternatives you've considered
Testing
Unit tests. Ran the exhaustive mapgen test which is currently disabled. Other issues remain that prevent that from being re-enabled yet.
Additional context
(This is one of the issues I mentioned in #53698).