@@ -221,7 +221,9 @@ def create_items(self):
221
221
if (self .smz3World .Config .Keysanity ):
222
222
progressionItems = self .progression + self .dungeon + self .keyCardsItems + self .SmMapsItems
223
223
else :
224
- progressionItems = self .progression
224
+ progressionItems = self .progression
225
+ # Dungeons items here are not in the itempool and will be prefilled locally so they must stay local
226
+ self .multiworld .non_local_items [self .player ].value -= frozenset (item_name for item_name in self .item_names if TotalSMZ3Item .Item .IsNameDungeonItem (item_name ))
225
227
for item in self .keyCardsItems :
226
228
self .multiworld .push_precollected (SMZ3Item (item .Type .name , ItemClassification .filler , item .Type , self .item_name_to_id [item .Type .name ], self .player , item ))
227
229
@@ -548,11 +550,8 @@ def write_spoiler(self, spoiler_handle: TextIO):
548
550
549
551
def JunkFillGT (self , factor ):
550
552
poolLength = len (self .multiworld .itempool )
551
- playerGroups = self .multiworld .get_player_groups (self .player )
552
- playerGroups .add (self .player )
553
553
junkPoolIdx = [i for i in range (0 , poolLength )
554
- if self .multiworld .itempool [i ].classification in (ItemClassification .filler , ItemClassification .trap ) and
555
- self .multiworld .itempool [i ].player in playerGroups ]
554
+ if self .multiworld .itempool [i ].classification in (ItemClassification .filler , ItemClassification .trap )]
556
555
toRemove = []
557
556
for loc in self .locations .values ():
558
557
# commenting this for now since doing a partial GT pre fill would allow for non SMZ3 progression in GT
@@ -563,13 +562,15 @@ def JunkFillGT(self, factor):
563
562
poolLength = len (junkPoolIdx )
564
563
# start looking at a random starting index and loop at start if no match found
565
564
start = self .multiworld .random .randint (0 , poolLength )
565
+ itemFromPool = None
566
566
for off in range (0 , poolLength ):
567
567
i = (start + off ) % poolLength
568
568
candidate = self .multiworld .itempool [junkPoolIdx [i ]]
569
569
if junkPoolIdx [i ] not in toRemove and loc .can_fill (self .multiworld .state , candidate , False ):
570
570
itemFromPool = candidate
571
571
toRemove .append (junkPoolIdx [i ])
572
572
break
573
+ assert itemFromPool is not None , "Can't find anymore item(s) to pre fill GT"
573
574
self .multiworld .push_item (loc , itemFromPool , False )
574
575
loc .event = False
575
576
toRemove .sort (reverse = True )
0 commit comments