Report extraneous or insufficient items as warning.

This commit is contained in:
Fabian Dill
2020-08-02 01:14:57 +02:00
parent b4fd8f6bdc
commit cba2ecb80e

18
Fill.py
View File

@@ -76,8 +76,10 @@ def distribute_items_cutoff(world, cutoffrate=0.33):
world.push_item(spot_to_fill, item_to_place, True) world.push_item(spot_to_fill, item_to_place, True)
itempool.remove(item_to_place) itempool.remove(item_to_place)
fill_locations.remove(spot_to_fill) fill_locations.remove(spot_to_fill)
unplaced = [item.name for item in itempool]
logging.getLogger('').debug('Unplaced items: %s - Unfilled Locations: %s', [item.name for item in itempool], [location.name for location in fill_locations]) unfilled = [location.name for location in fill_locations]
if unplaced or unfilled:
logging.warning('Unplaced items: %s - Unfilled Locations: %s', unplaced, unfilled)
def distribute_items_staleness(world): def distribute_items_staleness(world):
@@ -158,8 +160,10 @@ def distribute_items_staleness(world):
itempool.remove(item_to_place) itempool.remove(item_to_place)
fill_locations.remove(spot_to_fill) fill_locations.remove(spot_to_fill)
logging.getLogger('').debug('Unplaced items: %s - Unfilled Locations: %s', [item.name for item in itempool], [location.name for location in fill_locations]) unplaced = [item.name for item in itempool]
unfilled = [location.name for location in fill_locations]
if unplaced or unfilled:
logging.warning('Unplaced items: %s - Unfilled Locations: %s', unplaced, unfilled)
def fill_restrictive(world, base_state, locations, itempool, keys_in_itempool = None, single_player_placement = False): def fill_restrictive(world, base_state, locations, itempool, keys_in_itempool = None, single_player_placement = False):
def sweep_from_pool(): def sweep_from_pool():
@@ -299,8 +303,10 @@ def distribute_items_restrictive(world, gftower_trash=False, fill_locations=None
fast_fill(world, restitempool, fill_locations) fast_fill(world, restitempool, fill_locations)
logging.getLogger('').debug('Unplaced items: %s - Unfilled Locations: %s', [item.name for item in progitempool + prioitempool + restitempool], [location.name for location in fill_locations]) unplaced = [item.name for item in prioitempool + restitempool]
unfilled = [location.name for location in fill_locations]
if unplaced or unfilled:
logging.warning('Unplaced items: %s - Unfilled Locations: %s', unplaced, unfilled)
def fast_fill(world, item_pool, fill_locations): def fast_fill(world, item_pool, fill_locations):
while item_pool and fill_locations: while item_pool and fill_locations: