Skip to content

fix(station): guard flora stamp paths + close enclosure ledge hole#135

Merged
marceld23 merged 1 commit into
mainfrom
fix/station-flora-void-stamp-and-ledge
Jun 29, 2026
Merged

fix(station): guard flora stamp paths + close enclosure ledge hole#135
marceld23 merged 1 commit into
mainfrom
fix/station-flora-void-stamp-and-ledge

Conversation

@marceld23

Copy link
Copy Markdown
Owner

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:

  1. Stamp paths wrote flora verbatim with no enclosure guard — StampPlayerStation (player-built station), and StampStation relied solely on the generator.
  2. Ledge hole in the live-placement check (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

  • New shared predicate 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.
  • IsFloraEnclosedForVoidWorld now delegates to the predicate (live placement).
  • StampPlayerStation and StampStation run 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.
  • Existing structural generator regression (DecorativePlants_StayInsideTheHull_NeverOpenToTheVoid) still green.
  • Full server suite 794 passed, 0 warnings. No client/Assets changes → no Unity build needed.

🤖 Generated with Claude Code

)

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>
@marceld23 marceld23 self-assigned this Jun 29, 2026
@marceld23 marceld23 merged commit 495e028 into main Jun 29, 2026
12 checks passed
@marceld23 marceld23 deleted the fix/station-flora-void-stamp-and-ledge branch June 29, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stations: flora at edges / stamp paths can lead into the void (#2 stamp guard + #3 ledge hole)

1 participant