mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Core: guard against plandoing items onto event locations (#2284)
This commit is contained in:
3
Fill.py
3
Fill.py
@@ -897,6 +897,7 @@ def distribute_planned(world: MultiWorld) -> None:
|
|||||||
for item_name in items:
|
for item_name in items:
|
||||||
item = world.worlds[player].create_item(item_name)
|
item = world.worlds[player].create_item(item_name)
|
||||||
for location in reversed(candidates):
|
for location in reversed(candidates):
|
||||||
|
if (location.address is None) == (item.code is None): # either both None or both not None
|
||||||
if not location.item:
|
if not location.item:
|
||||||
if location.item_rule(item):
|
if location.item_rule(item):
|
||||||
if location.can_fill(world.state, item, False):
|
if location.can_fill(world.state, item, False):
|
||||||
@@ -910,6 +911,8 @@ def distribute_planned(world: MultiWorld) -> None:
|
|||||||
err.append(f"{item_name} not allowed at {location}.")
|
err.append(f"{item_name} not allowed at {location}.")
|
||||||
else:
|
else:
|
||||||
err.append(f"Cannot place {item_name} into already filled location {location}.")
|
err.append(f"Cannot place {item_name} into already filled location {location}.")
|
||||||
|
else:
|
||||||
|
err.append(f"Mismatch between {item_name} and {location}, only one is an event.")
|
||||||
if count == maxcount:
|
if count == maxcount:
|
||||||
break
|
break
|
||||||
if count < placement['count']['min']:
|
if count < placement['count']['min']:
|
||||||
|
Reference in New Issue
Block a user