Merge branch 'keylock-validation' of https://github.com/compiling/ALttPEntranceRandomizer into keylock-validation

This commit is contained in:
aerinon
2020-02-19 13:27:20 -07:00
4 changed files with 52 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import zlib
from BaseClasses import World, CollectionState, Item, Region, Location, Shop
from Items import ItemFactory
from KeyDoorShuffle import validate_key_placement
from Regions import create_regions, create_shops, mark_light_world_regions, create_dungeon_regions
from InvertedRegions import create_inverted_regions, mark_dark_world_regions
from EntranceShuffle import link_entrances, link_inverted_entrances
@@ -134,6 +135,11 @@ def main(args, seed=None):
else:
fill_dungeons(world)
for player in range(1, world.players+1):
for key_layout in world.key_layout[player].values():
if not validate_key_placement(key_layout, world, player):
raise RuntimeError("Keylock detected: %s (Player %d)" % (key_layout.sector.name, player))
logger.info('Fill the world.')
if args.algorithm == 'flood':