forked from mirror/Archipelago
Core: use options.option_name instead of multiworld.option_name
This commit is contained in:
6
Main.py
6
Main.py
@@ -167,10 +167,12 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
|
||||
|
||||
# remove starting inventory from pool items.
|
||||
# Because some worlds don't actually create items during create_items this has to be as late as possible.
|
||||
if any(world.start_inventory_from_pool[player].value for player in world.player_ids):
|
||||
if any(getattr(world.worlds[player].options, "start_inventory_from_pool", StartInventoryPool({})).value for player in world.player_ids):
|
||||
logging.info("At least one game has start_inventory_from_pool")
|
||||
new_items: List[Item] = []
|
||||
depletion_pool: Dict[int, Dict[str, int]] = {
|
||||
player: world.start_inventory_from_pool[player].value.copy() for player in world.player_ids}
|
||||
player: getattr(world.worlds[player].options, "start_inventory_from_pool", StartInventoryPool({})).value.copy()
|
||||
for player in world.player_ids}
|
||||
for player, items in depletion_pool.items():
|
||||
player_world: AutoWorld.World = world.worlds[player]
|
||||
for count in items.values():
|
||||
|
||||
@@ -15,9 +15,9 @@ else:
|
||||
|
||||
def locality_needed(world: MultiWorld) -> bool:
|
||||
for player in world.player_ids:
|
||||
if world.local_items[player].value:
|
||||
if world.worlds[player].options.local_items.value:
|
||||
return True
|
||||
if world.non_local_items[player].value:
|
||||
if world.worlds[player].options.non_local_items.value:
|
||||
return True
|
||||
|
||||
# Group
|
||||
@@ -40,12 +40,12 @@ def locality_rules(world: MultiWorld):
|
||||
forbid_data[sender][receiver].update(items)
|
||||
|
||||
for receiving_player in world.player_ids:
|
||||
local_items: typing.Set[str] = world.local_items[receiving_player].value
|
||||
local_items: typing.Set[str] = world.worlds[receiving_player].options.local_items.value
|
||||
if local_items:
|
||||
for sending_player in world.player_ids:
|
||||
if receiving_player != sending_player:
|
||||
forbid(sending_player, receiving_player, local_items)
|
||||
non_local_items: typing.Set[str] = world.non_local_items[receiving_player].value
|
||||
non_local_items: typing.Set[str] = world.worlds[receiving_player].options.non_local_items.value
|
||||
if non_local_items:
|
||||
forbid(receiving_player, receiving_player, non_local_items)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user