From 3343d4e36438fecdd135e0db823a10c6a96e0f78 Mon Sep 17 00:00:00 2001 From: Doug Hoskisson Date: Thu, 18 Apr 2024 09:50:17 -0700 Subject: [PATCH] SM: clean post_fill function (#2863) --- worlds/sm/__init__.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/worlds/sm/__init__.py b/worlds/sm/__init__.py index 3e9015ea..7f12bf48 100644 --- a/worlds/sm/__init__.py +++ b/worlds/sm/__init__.py @@ -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?