Repository navigation
Map: a sure revisit drops paths the room no longer lists - #27
Merged
MHohlios merged 2 commits intoNov 3, 2026
Merged
Conversation
added 2 commits
November 2, 2026 22:27
A wrong guess between look-alike rooms could give a room a path the game never lists there, and links outlived every later visit. A sure arrival now drops the room's links in directions it no longer lists, and the far rooms' ways back along them, except through a known doorway.
A maze shows only the last square's exits, so its real ways in and out must not be dropped, on its side or the far side. Also bring the schema comment on links in line with the new rule.
MHohlios
deleted the
wiffletree/map-revisiting-a-room-drops-paths-the-game-no-lo
branch
November 3, 2026 11:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In an area with two look-alike rooms side by side (two "Southern Meadow"s), the map once mistook one for the other and gave the west meadow a south path that doesn't exist.
note_exitsrefreshed a room's exit list on every visit but never removed links, so the bogus path outlived every visit.What changed
Layout::drop_unlisted_links(map/layout.rs): on a sure arrival (the tracker is convinced, not adrift, not dark), the current room drops each link in a direction it no longer lists, and the far room drops its return link when that link points back.map/room.rsandpersist/schema.rsupdated to the new rule.Tests
a_sure_revisit_drops_a_path_the_room_no_longer_lists: reaches the bad state through a plausible walk (a crooked path fools the map into the wrong meadow), revisits surely, and checks the link is gone after reopening the database. It fails without the fix.a_maze_keeps_its_links_when_its_last_square_lists_fewer_exits.links_stay_when_a_room_later_lists_fewer_exitsis nowa_doorway_keeps_its_link_when_the_room_later_lists_fewer_exits: it sees a closed door first, since only a doorway's link now survives a missing listing.cargo fmt --check,cargo clippy --workspace --all-targets --release -- -D warningsandcargo test -p mudling-corepass.Follow-ups
crates/mudling-core/src/map/tracker.rs:382).Reviewed with Wiffletree: 1 full review and 1 re-check, 2 rounds (Tests, Claude, Style)