Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill: Crash if there are remaining unfilled locations #2830

Merged
merged 12 commits into from
Jan 13, 2025
Merged
20 changes: 20 additions & 0 deletions Fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,26 @@ def mark_for_locking(location: Location):
print_data = {"items": items_counter, "locations": locations_counter}
logging.info(f"Per-Player counts: {print_data})")

more_locations = locations_counter - items_counter
more_items = items_counter - locations_counter
for player in multiworld.player_ids:
if more_locations[player]:
logging.error(
f"Player {multiworld.get_player_name(player)} had {more_locations[player]} more locations than items.")
elif more_items[player]:
logging.warning(
f"Player {multiworld.get_player_name(player)} had {more_items[player]} more items than locations.")
if unfilled:
raise FillError(
f"Unable to fill all locations.\n" +
f"Unfilled Locations({len(unfilled)}): {unfilled}"
alwaysintreble marked this conversation as resolved.
Show resolved Hide resolved
)
else:
logging.warning(
f"Unable to place all items.\n" +
f"Unplaced items({len(unplaced)}): {unplaced}"
)


def flood_items(multiworld: MultiWorld) -> None:
# get items to distribute
Expand Down
Loading