fix(station): guard flora stamp paths + close enclosure ledge hole#135
Merged
Conversation
) Flora is a non-solid, transparent billboard (no collider, no opaque face), so a plant cell exposed to the void is both see-through AND walk-through into space. Two gaps let such plants reach a station: - The void-world stamp paths wrote flora verbatim, with no enclosure guard (StampPlayerStation; StampStation relied on the generator alone). - The live-placement enclosure check only required a solid floor beneath each open side, so a plant standing one or more cells in from an open ledge passed the one-cell test yet still opened onto the void. Replace the single-neighbour test with a shared bounded flood-fill predicate (FloraCellOpensToVoid): from the plant cell, walk the reachable foot-level space through non-solid cells; if any reachable cell has nothing solid beneath it, the plant opens onto the void. Reused by both live placement (IsFloraEnclosedForVoidWorld) and the void-world stamp paths, which now drop any flora cell that opens to the void. Not in scope (per #134): retroactive cleanup of worlds where a station was first boarded before the original fix — those keep their persisted grass until the cell is overwritten. A brand-new world is unaffected. Tests: FloraTests gains a flood-fill predicate test (sealed room safe; adjacent drop, deeper ledge and floorless plant all flagged). Full server suite 794 green, 0 warnings. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Closes #134.
Problem
Flora is a non-solid, transparent billboard (no collider, no opaque face), so a plant cell exposed to the void is both see-through and walk-through into space. Two gaps let such plants reach a station:
StampPlayerStation(player-built station), andStampStationrelied solely on the generator.IsFloraEnclosedForVoidWorld): it only required a solid floor beneath each open side, so a plant standing one or more cells in from an open ledge passed the one-cell test yet still opened onto the void.Change
FloraCellOpensToVoid(GameServerFlora.cs): from the plant cell, a bounded flood-fill walks the reachable foot-level space through non-solid cells; if any reachable cell has nothing solid beneath it, the plant opens onto the void. This replaces the single-neighbour test and also catches the deeper-ledge case.IsFloraEnclosedForVoidWorldnow delegates to the predicate (live placement).StampPlayerStationandStampStationrun the predicate over the structure's own cells and drop any flora cell that opens to the void — independent of how it was authored (editor palette, import, template).Note: the landed ship is a client-rendered structure object (not a block-grid stamp) since the ship-as-object refactor, so there is no ship-interior void-world stamp to guard.
Out of scope (per #134, accepted)
No retroactive cleanup of worlds where a station was first boarded before the original fix — those keep their persisted grass until the cell is overwritten. A brand-new world is unaffected.
Tests
FloraTests.FloraVoidEnclosure_FloodFill_DetectsExposedPlants_AcceptsSealedRooms: sealed room = safe; adjacent drop, deeper ledge, and floorless plant all flagged.DecorativePlants_StayInsideTheHull_NeverOpenToTheVoid) still green.client/Assetschanges → no Unity build needed.🤖 Generated with Claude Code