Stop shut doors turning interior rooms into solid rock - #5
Merged
Conversation
Connectivity pruning treated a closed door as a barrier, so any room the spanning tree happened to gate with one was declared unreachable and filled with stone. On the live build a 12x10 tavern came back as 56 rock and 64 floor — walls are edges precisely so an interior costs zero standable ground, and this was quietly undoing that. A closed door is a door; someone opens it. Structural reachability now blocks on walls and solid terrain only. Moment-to-moment passability is a different question and the engine already answers it through compileTerrain + reachableHexes, which do respect door state. The existing "no stranded hexes" test could not catch this: it called the same helper, so it was self-consistent with the bug. The seed it ran on also happened to roll all-open doors. Both new tests fail against the old code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Caught by driving the deployed build — an interior came back as 56 rock and 64 floor. Interiors should have zero solid hexes; walls are edges specifically so a room costs no standable ground.
Cause
reachableFrom— the generator's connectivity check — treated a shut door as a barrier. So any room the spanning tree happened to gate with a closed door was judged unreachable, and the prune pass filled it with stone.A closed door is a door. Someone opens it. Structural reachability blocks on walls and solid terrain only. Moment-to-moment passability is a different question, and the engine already answers it correctly through
compileTerrain+reachableHexes, which do respect door state.Why the tests missed it
Two reasons, both worth noting:
New tests
Both fail against the old code and pass against this one — verified by reverting just the source and re-running.
440 tests green, typecheck and build clean.
🤖 Generated with Claude Code