feat: PreferredLocationGroup support updated

This commit is contained in:
aerinon
2024-05-11 07:28:07 -06:00
parent 1f85bc5a8d
commit 8e1f2911cd
4 changed files with 23 additions and 8 deletions

View File

@@ -493,7 +493,7 @@ def config_sort(world):
if world.item_pool_config.verify:
config_sort_helper(world, world.item_pool_config.verify)
elif world.item_pool_config.preferred:
config_sort_helper(world, world.item_pool_config.preferred)
config_sort_helper_random(world, world.item_pool_config.preferred)
def config_sort_helper(world, sort_dict):
@@ -503,6 +503,10 @@ def config_sort_helper(world, sort_dict):
if (i.name, i.player) in sort_dict else 0)
def config_sort_helper_random(world, sort_dict):
world.itempool.sort(key=lambda i: 1 if (i.name, i.player) in sort_dict else 0)
def calc_trash_locations(world, player):
total_count, gt_count = 0, 0
for loc in world.get_locations():