[TLOZ] Fix start weapon locations (#1802)

* Fix starting weapon locations usage

Makes a fresh copy of starting weapon locations when get_pool_core is ran
Should fix the issue of dangerous_weapon_locations getting appended to the list for other worlds past the first world that has dangerous StartingPosition, as well as running into the error if ExpandedPool was different between players
Credit for fix goes to @Silvris in the AP Discord
This commit is contained in:
t3hf1gm3nt 2023-05-08 16:36:35 -04:00 committed by GitHub
parent a8b76b1310
commit c74577d708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -92,16 +92,17 @@ def get_pool_core(world):
placed_items[location] = item placed_items[location] = item
# Starting Weapon # Starting Weapon
start_weapon_locations = starting_weapon_locations.copy()
starting_weapon = random.choice(starting_weapons) starting_weapon = random.choice(starting_weapons)
if world.multiworld.StartingPosition[world.player] == StartingPosition.option_safe: if world.multiworld.StartingPosition[world.player] == StartingPosition.option_safe:
placed_items[starting_weapon_locations[0]] = starting_weapon placed_items[start_weapon_locations[0]] = starting_weapon
elif world.multiworld.StartingPosition[world.player] in \ elif world.multiworld.StartingPosition[world.player] in \
[StartingPosition.option_unsafe, StartingPosition.option_dangerous]: [StartingPosition.option_unsafe, StartingPosition.option_dangerous]:
if world.multiworld.StartingPosition[world.player] == StartingPosition.option_dangerous: if world.multiworld.StartingPosition[world.player] == StartingPosition.option_dangerous:
for location in dangerous_weapon_locations: for location in dangerous_weapon_locations:
if world.multiworld.ExpandedPool[world.player] or "Drop" not in location: if world.multiworld.ExpandedPool[world.player] or "Drop" not in location:
starting_weapon_locations.append(location) start_weapon_locations.append(location)
placed_items[random.choice(starting_weapon_locations)] = starting_weapon placed_items[random.choice(start_weapon_locations)] = starting_weapon
else: else:
pool.append(starting_weapon) pool.append(starting_weapon)
for other_weapons in starting_weapons: for other_weapons in starting_weapons: