Fix two Jul-16 regressions: BT_DEV_GAUGES crash + -net dead controls mapper
Both surfaced today (dormant ~1 day) the moment the pod launch flags
(BT_DEV_GAUGES=1 BT_START_INSIDE=1, tools/mp_launch.sh) were used to drive in
multiplayer -- which made the same-day paint change look guilty. Confirmed on
the pre-paint build too; the trigger was the Jul-16 audio attribute work.
1) BT_DEV_GAUGES crash (cdb: CoolingLoopConnection::Update, ~15s in as the gauge
builds lazily). The dev-gauge cooling-loop lamp reached the cooling master by
RAW attribute index -- GetAttributePointer(3) + *(master+0x1d4). The audio
commits (cc2b109 ReportLeak etc.) inserted rows into the chained attribute
tables, so index 3 shifted onto a scalar, the resolve walked garbage, and the
background pass AV'd. Fix: route through a complete-type bridge reading NAMED
members (heat.cpp BTCoolingLoopFrame: linkedSinks.Resolve() +
Condenser::condenserNumber) -- the databinding rule; never a raw numeric
attribute index. Removed the now-orphaned GetAttributePointer-by-index
helper. Name-keyed samplers (InputVoltage) were unaffected.
2) -net dead controls mapper (mech wouldn't walk; turning/weapons still worked).
The RIO mapper is built from a stack SubsystemResource in btl4app.cpp that set
only name/classID/modelSize -- leaving subsystemFlags as stack GARBAGE, which
Subsystem::Subsystem copies into simulationFlags. A stray DontExecuteFlag
(0x2) froze the mapper (speedDemand stuck at 0). Config-dependent: clean in
SP, dirty in -net; the audio commits shifted the stack and flipped the bit.
Fix: memset each hand-built control-mapper resource to 0 (flags 0 =
AlwaysExecute, the faithful value -- a mapper must tick every frame).
Verified with the pod launch flags: SP alive 32s no crash; MP mech walks
(speedDemand 61.5 at full throttle, ~430u traveled), both nodes alive, no crash.
KB: reconstruction-gotchas.md gains gotcha 18 (uninitialized stack-resource
flags + the raw-attribute-index-into-a-growing-table variant) and a
verify-under-the-user's-launch-flags note.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
e0474ff92a
commit
63250aee41
@@ -1123,3 +1123,31 @@ Subsystem *CreateCondenserSubsystem(Mech *owner, int id, void *seg)
|
||||
|
||||
// CreateHeatSinkBankSubsystem (0xBBE) now lives in heatfamily_reslice.cpp -- it
|
||||
// builds the real AggregateHeatSink (which needs that TU's class definition).
|
||||
|
||||
//===========================================================================//
|
||||
// Gauge cooling-loop bridge (task #7 regression fix, 2026-07-17).
|
||||
//
|
||||
// The dev-gauge CoolingLoopConnection (btl4gau2.cpp @004c31a0) reached the
|
||||
// cooling master with a RAW attribute index (GetAttributePointer(3)) and then
|
||||
// raw-read master+0x1d4. The binary heat attribute table (@0x50e438..0x50e4c8)
|
||||
// shows id 3 == "HeatSink" == the linkedSinks plug, and +0x1d4 on the resolved
|
||||
// master is Condenser::condenserNumber (the loop number that selects the
|
||||
// image-strip frame). The numeric-id read crashed when the AUDIO_FIDELITY rows
|
||||
// (ReportLeak et al., cc2b109) grew the chained tables: index 3 landed on a
|
||||
// scalar, the resolve walked garbage, and the gauge background pass AV'd
|
||||
// (BT_DEV_GAUGES=1, the pod launch flag). House rule (gotcha 8): named members
|
||||
// via a complete-type TU -- never a raw numeric attribute index.
|
||||
//===========================================================================//
|
||||
int BTCoolingLoopFrame(void *subsystem_v)
|
||||
{
|
||||
Subsystem *sub = (Subsystem *)subsystem_v;
|
||||
if (sub == 0 || !sub->IsDerivedFrom(*HeatSink::GetClassDerivations()))
|
||||
return 0;
|
||||
HeatSink *sink = (HeatSink *)sub;
|
||||
if (sink->coolantAvailable != 1) // the binary's src+0x134 gate
|
||||
return 0;
|
||||
Subsystem *master = sink->linkedSinks.Resolve(); // attr id 3 "HeatSink" + FUN_00417ab4
|
||||
if (master == 0 || !master->IsDerivedFrom(*Condenser::GetClassDerivations()))
|
||||
return 0;
|
||||
return ((Condenser *)master)->condenserNumber; // master+0x1d4 (loop/frame number)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user