Issue #31: wire the EJECT button (EjectAmmo msg 0xb @004bb9b8) -- the in-mission unjam

Disasm-faithful transcription of the export-gap handler onto
ProjectileWeapon (MESSAGE_ENTRY id 0xb, the #19 pattern).  PRESS arms
the ~3s UpdateEject countdown (bin alarm -> Ejecting(3); gate 2 parks
the weapon offline mid-eject -- authentic).  HOLD to completion =
DumpAmmo jettisons the bay -> NoAmmo.  TAP (release early) cycles ONE
round out via FeedAmmo and returns the weapon to Loading -- clears a
jam at the cost of a round (and recovers a FailureHeat 7 while rounds
remain).  Binary structure kept exactly incl. the press-no-bin
fall-through into the release block.

AmmoBin: Ejecting(3)/Ejected(4) alarm levels decoded + named
SetAmmoState accessor (databinding rule).  Always-on forensics:
'[weap] EJECT tap' + '[ammo] bay DUMPED overboard (N rounds)'.

Rig-verified live (BT_EJECTTEST=1 / =hold on LRM15): taps eject one
round each and return the weapon to service (15->8 across cycles);
hold dumps all 16 -> NoAmmo.  Awaiting a human press of the actual
ENG-page button on a jammed weapon.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-23 13:49:11 -05:00
co-authored by Claude Opus 4.8
parent 225fe43f0c
commit 2edd1b5363
7 changed files with 134 additions and 8 deletions
+30
View File
@@ -5753,6 +5753,36 @@ void
}
}
// issue #31 verify (BT_EJECTTEST): pulse the EJECT button on the first
// MissileLauncher (0xBD0) -- press, then release ~2s later (inside the
// 3s countdown => a TAP: one round out, weapon back to Loading).
// BT_EJECTTEST=hold releases at ~5s instead (past the countdown => the
// HOLD: UpdateEject completes, DumpAmmo jettisons the bay -> NoAmmo).
// The [weap] EJECT tap log + [ammo] counts verify the @004bb9b8 wiring.
const char *ejectTest = getenv("BT_EJECTTEST");
if (ejectTest && (Entity *)this == application->GetViewpointEntity())
{
static int s_ejectTest = 0;
int releaseAt = (*ejectTest == 'h') ? 300 : 120; // 5s (hold) vs 2s (tap)
int phase = ++s_ejectTest % 480; // 8s cycle @60Hz
if (phase == 0 || phase == releaseAt) // press at 0, release later
{
for (int s = 1; s < GetSubsystemCount(); ++s)
{
Subsystem *sub = GetSubsystem(s);
if (sub != 0 && (int)sub->GetClassID() == 0xBD0)
{
ReceiverDataMessageOf<ControlsButton> msg(
0x0b /*ProjectileWeapon::EjectAmmoMessageID*/,
sizeof(ReceiverDataMessageOf<ControlsButton>),
(ControlsButton)(phase == 0 ? 1 : 0));
sub->Dispatch(&msg);
break;
}
}
}
}
// issue #20 verify (BT_BALTEST): alternate a MoveValve (id 4) press to
// the first condenser with a Mech BalanceCoolant (id 0x16) press every
// ~2s -- BT_VALVE_LOG shows the valve going 1->5 then BALANCE pulling