Loot-1 fix batch: whole-or-nothing commodity store, and tests for the Soul s1/s2 findings

EquippedCargoBay.TryStore(SimpleCommodity) now returns false before touching anything when
TryFindSpace says the whole quantity does not fit (its documented contract: true only when ALL
is stored), so Zone.TryPickUp keeps "first accepting bay, otherwise nothing changes" with no
rollback in Zone. Tests: refused pickup of a stackable item changes nothing; a stack plus free
cell stores whole; first accepting bay; headings cover the circle; the loot stream is not the
mine stream; dock/undock and jump drop once and only in the zone the ship is in.
Untested on this commit: not yet built (verify job follows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-12 20:51:45 +02:00
commit cc9403ce58
3 changed files with 159 additions and 1 deletions

View file

@ -2376,7 +2376,7 @@ public class EquippedCargoBay : EquippedItem
// Returns true only when ALL of the items are successfully stored
public bool TryStore(SimpleCommodity item)
{
TryFindSpace(item, out var positions);
if (!TryFindSpace(item, out var positions)) return false;
foreach (var position in positions)
{
if (TryStore(item, position)) return true;