LttP: fix ganons tower trash fill deleting items that did not fit (#1113)

This commit is contained in:
Fabian Dill 2022-10-17 09:52:34 +02:00 committed by GitHub
parent b533ffb9e8
commit 1aa3e431c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -490,11 +490,15 @@ class ALTTPWorld(World):
while gtower_locations and filleritempool and trash_count > 0:
spot_to_fill = gtower_locations.pop()
item_to_place = filleritempool.pop()
if spot_to_fill.item_rule(item_to_place):
world.push_item(spot_to_fill, item_to_place, False)
fill_locations.remove(spot_to_fill) # very slow, unfortunately
trash_count -= 1
for index, item in enumerate(filleritempool):
if spot_to_fill.item_rule(item):
filleritempool.pop(index) # remove from outer fill
world.push_item(spot_to_fill, item, False)
fill_locations.remove(spot_to_fill) # very slow, unfortunately
trash_count -= 1
break
else:
logging.warning(f"Could not trash fill Ganon's Tower for player {player}.")
def get_filler_item_name(self) -> str:
if self.world.goal[self.player] == "icerodhunt":