Fix for incorrect keylock situation
Fix for spoiler playthrough (makes things pretty slow though)
This commit is contained in:
@@ -796,7 +796,8 @@ class CollectionState(object):
|
|||||||
rule = key_logic.door_rules[door.name]
|
rule = key_logic.door_rules[door.name]
|
||||||
key = KeyRuleType.AllowSmall
|
key = KeyRuleType.AllowSmall
|
||||||
if (key in rule.new_rules and key_total >= rule.new_rules[key] and door.name not in skip
|
if (key in rule.new_rules and key_total >= rule.new_rules[key] and door.name not in skip
|
||||||
and door.name in state.reached_doors[player] and door.name not in state.opened_doors[player]):
|
and door.name in state.reached_doors[player] and door.name not in state.opened_doors[player]
|
||||||
|
and rule.small_location.item is None):
|
||||||
if paired:
|
if paired:
|
||||||
door_candidates.append((door.name, paired.name))
|
door_candidates.append((door.name, paired.name))
|
||||||
skip.add(paired.name)
|
skip.add(paired.name)
|
||||||
|
|||||||
11
Main.py
11
Main.py
@@ -308,6 +308,7 @@ def main(args, seed=None, fish=None):
|
|||||||
balance_multiworld_progression(world)
|
balance_multiworld_progression(world)
|
||||||
|
|
||||||
# if we only check for beatable, we can do this sanity check first before creating the rom
|
# if we only check for beatable, we can do this sanity check first before creating the rom
|
||||||
|
world.clear_exp_cache()
|
||||||
if not world.can_beat_game(log_error=True):
|
if not world.can_beat_game(log_error=True):
|
||||||
raise RuntimeError(world.fish.translate("cli", "cli", "cannot.beat.game"))
|
raise RuntimeError(world.fish.translate("cli", "cli", "cannot.beat.game"))
|
||||||
|
|
||||||
@@ -546,10 +547,8 @@ def copy_world(world):
|
|||||||
new_location.item = item
|
new_location.item = item
|
||||||
item.location = new_location
|
item.location = new_location
|
||||||
item.world = ret
|
item.world = ret
|
||||||
if location.event:
|
new_location.event = location.event
|
||||||
new_location.event = True
|
new_location.locked = location.locked
|
||||||
if location.locked:
|
|
||||||
new_location.locked = True
|
|
||||||
# these need to be modified properly by set_rules
|
# these need to be modified properly by set_rules
|
||||||
new_location.access_rule = lambda state: True
|
new_location.access_rule = lambda state: True
|
||||||
new_location.item_rule = lambda state: True
|
new_location.item_rule = lambda state: True
|
||||||
@@ -660,8 +659,8 @@ def create_playthrough(world):
|
|||||||
old_item = location.item
|
old_item = location.item
|
||||||
location.item = None
|
location.item = None
|
||||||
# todo: this is not very efficient, but I'm not sure how else to do it for this backwards logic
|
# todo: this is not very efficient, but I'm not sure how else to do it for this backwards logic
|
||||||
# world.clear_exp_cache()
|
world.clear_exp_cache()
|
||||||
if world.can_beat_game(state_cache[num]):
|
if world.can_beat_game(state_cache[max(num-1, 0)]):
|
||||||
logging.getLogger('').debug(f'{old_item.name} (Player {old_item.player}) is not required')
|
logging.getLogger('').debug(f'{old_item.name} (Player {old_item.player}) is not required')
|
||||||
to_delete.add(location)
|
to_delete.add(location)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user