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,16 +358,26 @@ class SMWorld(World):
def post_fill(self):
def get_player_ItemLocation(progression_only: bool):
return [
ItemLocation(copy.copy(ItemManager.Items[
itemLoc.item.type 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,
True)
for itemLoc in spheres if itemLoc.item.player == self.player and (not progression_only or itemLoc.item.advancement)
]
ItemLocation(
copy.copy(
ItemManager.Items[
itemLoc.item.type
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,
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.
# We cant use stage_post_fill for this as its called after worlds' post_fill.
# get_spheres could be cached in multiworld?