Skip to content

Commit 198dc07

Browse files
committed
handle multiple choices for song from impa
1 parent 89cc749 commit 198dc07

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Fill.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,15 @@ def distribute_items_restrictive(worlds: list[World], fill_locations: Optional[l
182182
# gets a song and not some other type of item when songs on songs is
183183
# enabled.
184184
impas: list[Location] = []
185+
impas_songs: list[Item] = []
185186
for world in worlds:
186187
if world.skip_child_zelda and world.settings.shuffle_song_items == 'song':
187-
impas.append(world.get_location('Song from Impa'))
188-
if impas:
189-
fill_ownworld_restrictive(worlds, search, impas, songitempool, progitempool, "song")
188+
own_songs = [song for song in songitempool if song.world.id == world.id]
189+
if own_songs:
190+
impas.append(world.get_location('Song from Impa'))
191+
impas_songs.append(random.choice(own_songs))
192+
if impas and impas_songs:
193+
fill_ownworld_restrictive(worlds, search, impas, impas_songs, progitempool, "song")
190194
fill_ownworld_restrictive(worlds, search, song_locations, songitempool, progitempool, "song")
191195
search.collect_locations()
192196
fill_locations += [location for location in song_locations if location.item is None]

0 commit comments

Comments
 (0)