The Messenger: fix items accessibility reachability bug due to new rules (#2937)

This commit is contained in:
Aaron Wagener 2024-03-11 18:55:28 -05:00 committed by GitHub
parent a7384b4b63
commit 6d3f7865ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View File

@ -523,7 +523,7 @@ class MessengerOOBRules(MessengerRules):
def set_self_locking_items(world: "MessengerWorld", player: int) -> None:
# locations where these placements are always valid
allow_self_locking_items(world.get_location("Searing Crags - Key of Strength"), "Power Thistle")
allow_self_locking_items(world.get_location("Searing Crags - Key of Strength").parent_region, "Power Thistle")
allow_self_locking_items(world.get_location("Sunken Shrine - Key of Love"), "Sun Crest", "Moon Crest")
allow_self_locking_items(world.get_location("Corrupted Future - Key of Courage"), "Demon King Crown")
allow_self_locking_items(world.get_location("Corrupted Future - Key of Courage").parent_region, "Demon King Crown")
allow_self_locking_items(world.get_location("Elemental Skylands Seal - Water"), "Currents Master")

View File

@ -1,3 +1,5 @@
import typing
from . import MessengerTestBase
from ..constants import NOTES, PHOBEKINS
@ -208,5 +210,8 @@ class ItemsAccessTest(MessengerTestBase):
for item_name in location_lock_pairs[loc]:
item = self.get_item_by_name(item_name)
with self.subTest("Fulfills Accessibility", location=loc, item=item_name):
self.assertTrue(self.multiworld.get_location(loc, self.player).can_fill(self.multiworld.state, item,
True))
location = self.multiworld.get_location(loc, self.player)
self.assertTrue(location.can_fill(self.multiworld.state, item, True))
location.item = item
self.multiworld.state.update_reachable_regions(self.player)
self.assertTrue(self.can_reach_location(loc))