Diag: BT_JAM_LOG (per-shot weapon temp/jam roll) + BT_VALVE (force condenser detent)

Probes for verifying the autocannon jam/coolant mechanic against QA ground-truth
(AFCs jam on ~3rd shot uncooled). BT_JAM_LOG logs currentTemp/degradT/failT/alarm/p
at each fire attempt; BT_VALVE=<n> forces every condenser valveState so cooling can
be tested at a known level. No behavior change (both gated on env).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-14 06:34:37 -05:00
co-authored by Claude Fable 5
parent 844edbd2aa
commit 3acab416ee
2 changed files with 26 additions and 0 deletions
+16
View File
@@ -977,6 +977,22 @@ void BTRecomputeCondenserValves(Entity *owner)
Derivation &condClass = *Condenser::GetClassDerivations();
int count = owner->GetSubsystemCount();
// DIAG (BT_VALVE=<n>): force every condenser's valve detent so the coolant/jam
// mechanic can be tested at a known coolant level (0=closed/uncooled .. 50=max).
{
const char *fv = getenv("BT_VALVE");
if (fv && fv[0])
{
int v = atoi(fv);
for (int i = 0; i < count; ++i)
{
Subsystem *s = owner->GetSubsystem(i);
if (s != 0 && s->IsDerivedFrom(condClass))
((Condenser *)s)->valveState = v;
}
}
}
// pass 1: total valve opening across all condensers
int total = 0;
for (int i = 0; i < count; ++i)
+10
View File
@@ -517,6 +517,16 @@ void
Logical
ProjectileWeapon::CheckForJam()
{
if (getenv("BT_JAM_LOG"))
DEBUG_STREAM << "[jam] " << GetName()
<< " T=" << currentTemperature
<< " degT=" << degradationTemperature
<< " failT=" << failureTemperature
<< " alarm=" << (int)heatAlarm.GetLevel()
<< " liveFire=" << (int)LiveFireEnabled()
<< " p=" << ((_DAT_004bc064 * currentTemperature) / failureTemperature)
<< "\n" << std::flush;
if (!LiveFireEnabled()) // *(*(this+0xd0)+400)+0x25c
return False;