Weighting every containing obstacle by depth let a hive's 0.5 AU range
outweigh the planet right below the mecha, so a take-off under a hive
steered back into the ground.
Stars and planets keep their priority over hives, as before this branch:
while the mecha is inside any star or planet range, hives take no part.
Overlapping star and planet ranges are still left together, weighted by
depth; their safety margins are equal, so the nearest surface dominates.
Inside hive ranges only, the first containing hive is left, as before.
Add tools/tests/Test-AutoCruiseAvoidance.ps1: an offline check of the
avoidance heading for a plain take-off, a take-off under an overlapping
hive range, a take-off from a moon inside its gas giant's range, and a
hive on its own.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ComputeDirection returned the escape heading of the first obstacle in the
list whose path radius contains the mecha. A mecha standing on a moon close
to its gas giant is inside two path radii at once (the moon's 2200 m and the
giant's 2800 m), and the giant comes first. Taking off from the moon's
giant-facing side, "away from the giant" points into the ground: the mecha
dives right after entering space, drops back under the game's landing rule,
takes off again, and so on.
Sum the inward directions of all obstacles that contain the mecha, each
weighted by how deep the mecha is inside it, and escape from that. The body
right below dominates near its surface. Route blocking is checked only when
the mecha is inside no obstacle, as before for a single obstacle.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>