Skip to content

Commit

Permalink
Merge pull request #398 from CovenEsme/fix-mixed-pools-presets-bug
Browse files Browse the repository at this point in the history
Ensure empty mixed pools also get saved to config/presets
  • Loading branch information
CovenEsme authored Jul 19, 2024
2 parents 95ebe8e + 8cbc35c commit 92de8a5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions logic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import yaml
from constants.configconstants import (
CONFIG_FIELDS,
ENTRANCE_TYPES,
PREFERENCE_FIELDS,
SETTING_ALIASES,
get_default_setting,
Expand Down Expand Up @@ -166,10 +167,12 @@ def write_config_to_file(filename: Path, config: Config):
config_out[world_num]["excluded_hint_locations"].append(loc)

# Map mixed pools
config_out[world_num]["mixed_entrance_pools"] = []
config_out[world_num]["mixed_entrance_pools"] = [
list() for _ in range(len(ENTRANCE_TYPES) - 1)
]

for pool in setting_map.mixed_entrance_pools:
config_out[world_num]["mixed_entrance_pools"].append(pool)
for pool_index, pool in enumerate(setting_map.mixed_entrance_pools):
config_out[world_num]["mixed_entrance_pools"][pool_index] = pool

yaml.safe_dump(config_out, config_file, sort_keys=False)

Expand Down

0 comments on commit 92de8a5

Please sign in to comment.