AHiT: Fix reconnecting rift access regions for starting and plando acts #4200
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.
What is this fixing or adding?
Reconnecting an act in a telescope to a time rift removes the entrances to the time rift from its access regions because it will be accessible from the telescope instead.
By doing so early on, as a starting act with insanity act randomizer or as a plando-ed act, this can happen before the time rift itself has been reconnected to an act or other time rift. In which case, when later attempting to connect that time rift to an act or other time rift, the entrances from the rift access regions will no longer exist, so must be re-created. The original code was mistakenly re-creating the entrances from the time rift being reconnected, instead of from the rift access regions.
I'm not sure the entrances need to be removed in the first place and I think a better fix would be to not create the entrances until after act randomization is completed so that all the entrance reconnecting can be entirely avoided, but these changes would be larger, so I have made the simple fix for now.
How was this tested?
I have been writing logic tests as well as a fixing a number of minor/inconsequential logic issues that are not yet ready for review. The tests were what initially identified this issue.
To reproduce this issue with random seeds, either play with insanity act randomizer and a Chapter 1 or 2 start until a purple Time Rift gets chosen as one of the starting acts, or use act-plando to place Time Rifts on telescope acts, e.g.
The playthrough from fully generating the same seed that failed the test contained a nonsensical path to reach
Time Rift - Deep Sea
because Time Rift levels do not contain Time Rift entrances (indicated by the entrance using the word "Portal"):By visualising the regions, it could be seen that
Time Rift - Dead Bird Studio
(placed at Chapter 1 Act 1) had two unexpected connections toTime Rift - Deep Sea
, which was actually placed whereTime Rift - Dead Bird Studio
would be in vanilla.After this PR, the visualised regions show that
Time Rift - Dead Bird Studio
correctly connects to only the acts placed at Chapter 1 Act 2 and Chapter 1 Act 3, withTime Rift - Deep Sea
being connected fromDead Bird Studio
andDead Bird Studio Basement
as expected.