Skip to content

Commit

Permalink
[TLOZ] Fix start weapon locations (ArchipelagoMW#1802)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
t3hf1gm3nt authored May 8, 2023
1 parent a8b76b1 commit c74577d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions worlds/tloz/ItemPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ def get_pool_core(world):
placed_items[location] = item

# Starting Weapon
start_weapon_locations = starting_weapon_locations.copy()
starting_weapon = random.choice(starting_weapons)
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 \
[StartingPosition.option_unsafe, StartingPosition.option_dangerous]:
if world.multiworld.StartingPosition[world.player] == StartingPosition.option_dangerous:
for location in dangerous_weapon_locations:
if world.multiworld.ExpandedPool[world.player] or "Drop" not in location:
starting_weapon_locations.append(location)
placed_items[random.choice(starting_weapon_locations)] = starting_weapon
start_weapon_locations.append(location)
placed_items[random.choice(start_weapon_locations)] = starting_weapon
else:
pool.append(starting_weapon)
for other_weapons in starting_weapons:
Expand Down

0 comments on commit c74577d

Please sign in to comment.