Skip to content

Commit 6d3f786

Browse files
The Messenger: fix items accessibility reachability bug due to new rules (#2937)
1 parent a7384b4 commit 6d3f786

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

worlds/messenger/rules.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def set_messenger_rules(self) -> None:
523523

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

worlds/messenger/test/test_access.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import typing
2+
13
from . import MessengerTestBase
24
from ..constants import NOTES, PHOBEKINS
35

@@ -208,5 +210,8 @@ def test_self_locking_items(self) -> None:
208210
for item_name in location_lock_pairs[loc]:
209211
item = self.get_item_by_name(item_name)
210212
with self.subTest("Fulfills Accessibility", location=loc, item=item_name):
211-
self.assertTrue(self.multiworld.get_location(loc, self.player).can_fill(self.multiworld.state, item,
212-
True))
213+
location = self.multiworld.get_location(loc, self.player)
214+
self.assertTrue(location.can_fill(self.multiworld.state, item, True))
215+
location.item = item
216+
self.multiworld.state.update_reachable_regions(self.player)
217+
self.assertTrue(self.can_reach_location(loc))

0 commit comments

Comments
 (0)