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
None
Purpose of change
Followup to #68324. I wasn't happy with the solution and felt it deserved more documentation. I also realize I missed an else clause during world generation which could have affected what omts spawn over others (if you have sequential linear OMTs of different types). I'm not sure this is actually a case that happens but in theory there could be a linear omt that requires a predecessor and that predecessor itself could be linear (I dunno) so we should allow stacking those.
Describe the solution
Redo the logic with extra wextra comments. Make the mapgen logic and savegame deserialization logic use almost literally exactly the same code. I could've factored it into a helper function maybe but the way it would possibly mutate local or non-local state made me a bit wary to do so. I could still try though. I want to get this in front of eyes sooner though.
Describe alternatives you've considered
Testing
Loaded the old save from #67837 and validated the deserialize logic works. Created a new save in the same build, crossroads still have manholes sometimes.
You can still get 4 way streets over manholes over 4 way streets. Not sure if this means those intersections are susceptible to extra spawning, but the one I found did not seem over full.
Roads still overwrite trails correctly (presuming trails are linear and roads are linear, this means my safety net for linear-over-linear is working).
And extra special verification that savegame recover works. This save had 7 duplicate omts serialized. It only pushes the one halfway through the list.
Additional context