SM: clean post_fill function (#2863)

This commit is contained in:
Doug Hoskisson 2024-04-18 09:50:17 -07:00 committed by GitHub
parent 1faaa0d941
commit 3343d4e364
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 10 deletions

View File

@ -358,14 +358,24 @@ class SMWorld(World):
def post_fill(self): def post_fill(self):
def get_player_ItemLocation(progression_only: bool): def get_player_ItemLocation(progression_only: bool):
return [ return [
ItemLocation(copy.copy(ItemManager.Items[ ItemLocation(
itemLoc.item.type if isinstance(itemLoc.item, SMItem) and itemLoc.item.type in ItemManager.Items else copy.copy(
'ArchipelagoItem']), ItemManager.Items[
copy.copy(locationsDict[itemLoc.name] if itemLoc.game == self.game else itemLoc.item.type
locationsDict[first_local_collected_loc.name]), if isinstance(itemLoc.item, SMItem) and itemLoc.item.type in ItemManager.Items
else 'ArchipelagoItem'
]
),
copy.copy(
locationsDict[itemLoc.name]
if itemLoc.game == self.game
else locationsDict[first_local_collected_loc.name]
),
itemLoc.item.player, itemLoc.item.player,
True) True
for itemLoc in spheres if itemLoc.item.player == self.player and (not progression_only or itemLoc.item.advancement) )
for itemLoc in spheres
if itemLoc.item.player == self.player and (not progression_only or itemLoc.item.advancement)
] ]
# Having a sorted itemLocs from collection order is required for escapeTrigger when Tourian is Disabled. # Having a sorted itemLocs from collection order is required for escapeTrigger when Tourian is Disabled.