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,15 +358,25 @@ 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
itemLoc.item.player, else 'ArchipelagoItem'
True) ]
for itemLoc in spheres if itemLoc.item.player == self.player and (not progression_only or itemLoc.item.advancement) ),
] copy.copy(
locationsDict[itemLoc.name]
if itemLoc.game == self.game
else locationsDict[first_local_collected_loc.name]
),
itemLoc.item.player,
True
)
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.
# We cant use stage_post_fill for this as its called after worlds' post_fill. # We cant use stage_post_fill for this as its called after worlds' post_fill.