spaceship/core
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Claude 840f9aa9a0 #224: refuse to build a structure on top of another
BuildingField.place() dropped a structure at the fleet centroid with no
overlap check of any kind, so they could be stacked.

It reads worse than it looks. BuildingField decides which structure the
fleet is standing on by testing the centroid against interact_radius and
returning the FIRST match, so two structures inside one another make that a
question of list order rather than of where the player flew - you could fly
to your workshop and open the crafter.

The separation is interact_radius itself (150) rather than a new number,
because that is exactly the circle the ambiguity comes from. Buildings draw
to a radius of roughly 60, so this leaves a visible gap rather than letting
them touch.

Gated in three places: the info popup (the button greys out and says which
structure is in the way), _confirm_build, and _try_place - the preview goes
stale as the fleet keeps moving.

Ordering matters in one case. A unique structure replaces itself by
demolishing the old one BEFORE placing the new one, so a placement refused
afterwards would leave the player with neither. The check runs before the
demolition and excludes the structure being replaced. Case D pins it.

Two existing tests encoded the old permissive behaviour and now fly clear
first; neither is about placement:

  test_build_info_popup builds every menu option from one position, so
  each structure blocked the next
  test_payments_use_fleet_hold builds a mothership on the ship lab that
  an earlier case injects at the origin

Also fixes a bug from 37e2e89: Sfx.warm() called add_child() from _ready(),
which Godot refuses outright - it printed an error and never pre-built the
pool, defeating the point of warming it. Deferred, like Music.ensure().

173/173.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
2026-09-09 12:57:28 +02:00
..
CatalogCheck.gd Preserve packed definition arrays in exports 2026-08-31 15:23:25 +02:00
CatalogCheck.gd.uid #166-#173: plainer words, a point to shoot at, and a catalog that says when it is broken 2026-08-30 14:04:46 +02:00
CombatTarget.gd Complete lab, quest, garrison, and energy tickets 2026-09-03 00:12:08 +02:00
CombatTarget.gd.uid Complete lab, quest, garrison, and energy tickets 2026-09-03 00:12:08 +02:00
GameState.gd #224: refuse to build a structure on top of another 2026-09-09 12:57:28 +02:00
GameState.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
Quests.gd Find the planet setups in an exported build 2026-09-07 13:55:41 +02:00
Quests.gd.uid #129 (#131, #132, #133): a quest chain, and a World Ship out of reach 2026-08-28 14:41:03 +02:00
ViewUtils.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ViewUtils.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00