Plando: fix automatic locations only working for the first world #2063
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?
An issue would occur when attempting to plando items to multiple worlds of varying games. "location_names" would be populated by the locations of the first game, and then not cleaned afterwards. Thus, later iterations of the loop would fail as it would be looking for locations from the first game in subsequent games. This fixes the issue by setting "valid_locations" to a copy of "location_names" if it is non-empty or the list of locations per game if it is.
How was this tested?
https://cdn.discordapp.com/attachments/1135349606176260258/1135350398727766116/Plando_Dumping_All_Items_to_Single_Game.zip
Test sample given from bug report, "A Link to the Past" and "Ocarina of Time" have Triforce Pieces plando'd into 5 different worlds. Without this change, Triforce Pieces would only be placed into Radz Awakening and Radz 5 (both LADX), while with this change Triforce Pieces are placed into all 5 worlds.
If this makes graphical changes, please attach screenshots.