SMZ3: FixJunkFillGT making invalid placements
This commit is contained in:
parent
95012c004f
commit
530b6cc360
|
@ -77,7 +77,7 @@ class SMZ3World(World):
|
||||||
|
|
||||||
def __init__(self, world: MultiWorld, player: int):
|
def __init__(self, world: MultiWorld, player: int):
|
||||||
self.rom_name_available_event = threading.Event()
|
self.rom_name_available_event = threading.Event()
|
||||||
self.locations = {}
|
self.locations: Dict[str, Location] = {}
|
||||||
self.unreachable = []
|
self.unreachable = []
|
||||||
super().__init__(world, player)
|
super().__init__(world, player)
|
||||||
|
|
||||||
|
@ -481,15 +481,13 @@ class SMZ3World(World):
|
||||||
if loc.name in self.locationNamesGT and loc.item is None:
|
if loc.name in self.locationNamesGT and loc.item is None:
|
||||||
poolLength = len(self.world.itempool)
|
poolLength = len(self.world.itempool)
|
||||||
# start looking at a random starting index and loop at start if no match found
|
# start looking at a random starting index and loop at start if no match found
|
||||||
for i in range(self.world.random.randint(0, poolLength), poolLength):
|
start = self.world.random.randint(0, poolLength)
|
||||||
if not self.world.itempool[i].advancement:
|
for off in range(0, poolLength):
|
||||||
|
i = (start + off) % poolLength
|
||||||
|
if self.world.itempool[i].classification in (ItemClassification.filler, ItemClassification.trap) \
|
||||||
|
and loc.can_fill(self.world.state, self.world.itempool[i], False):
|
||||||
itemFromPool = self.world.itempool.pop(i)
|
itemFromPool = self.world.itempool.pop(i)
|
||||||
break
|
break
|
||||||
else:
|
|
||||||
for i in range(0, poolLength):
|
|
||||||
if not self.world.itempool[i].advancement:
|
|
||||||
itemFromPool = self.world.itempool.pop(i)
|
|
||||||
break
|
|
||||||
self.world.push_item(loc, itemFromPool, False)
|
self.world.push_item(loc, itemFromPool, False)
|
||||||
loc.event = False
|
loc.event = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue