#88 part 2: the central coolant pull-through -- HeatSink::DrawCoolant was a

return-0 stub; the Reservoir BAR now drops when a damaged mech leaks

The user watched the coolant panel's level bar during the leak bench and it
never moved -- correctly: a leaking subsystem drained only its own loop,
because the slot-14 top-up (DrawCoolant) was stubbed.  Disassembled the real
base @0x4add00: the draw RECURSES UP the sink linkage, scaling by
coolantFlowScale@0x15C per hop, terminating at the Reservoir's supply
(@0x4af3b0 -- clamp to [0, coolantLevel], drain the tank, return granted --
already faithfully ported as Reservoir::DrawCoolant).  The binary's terminal
hop is the bank's slot-14 override @0x4ae8b0 resolving its reservoir
connection @0x1D8 (the port's 'helper' member -- not vestigial after all);
the port's existing Reservoir-ctor Attach + Reservoir override terminate the
same chain equivalently (the extra bank hop scales by ctor-default 1.0).

Implemented the base recursion (null-guarded -- the binary calls through the
resolved link unguarded; authored topology always links) + a BT_COOL_LOG
[resdraw] probe at the supply.

Verified live: a destroyed myomer's damage leak pulled the central tank
6.0 -> 5.58 over ~30s ([resdraw] granted lines) -- Reservoir/CoolantMass,
the cockpit coolant bar, now visibly drops as a damaged mech bleeds
coolant, and DeathReset refills it on respawn.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Zh7PTkFy4KwTzVighLR9J
This commit is contained in:
Joe DiPrima
2026-07-31 08:47:55 -05:00
co-authored by Claude Fable 5
parent a8a0042f28
commit 31552c0444
3 changed files with 41 additions and 9 deletions
+21 -5
View File
@@ -1001,14 +1001,30 @@ void
}
//
// vtable slot 14 (@vtable+0x38). Base sinks supply nothing on their own;
// a central-cooling-system subclass overrides this.
// TODO: verify against the real slot-14 target (not captured in decomp).
// vtable slot 14 (@vtable+0x38) -- the base @0x4add00, disassembled + decoded
// 2026-07-31 (the old `return 0` stub was why a leaking subsystem could never
// pull from the central tank -- the Reservoir bar never moved on damage):
// linked = resolve(linkedSinks@0x164) ; FUN_00417ab4
// return linked->DrawCoolant(requested * coolantFlowScale@0x15C)
// i.e. the draw RECURSES UP the sink linkage, scaling per hop, and terminates
// at the Reservoir's own override (@0x4af3b0: clamp to [0, coolantLevel],
// drain the tank, return the granted amount). In the binary the terminal hop
// is the bank's slot-14 override @0x4ae8b0 resolving its reservoir connection
// @0x1D8; in the port the reservoir sits in the bank's linkedSinks (the
// Reservoir-ctor Attach) and Reservoir::DrawCoolant IS the @0x4af3b0 body, so
// the same chain terminates identically (the extra bank hop multiplies by its
// coolantFlowScale, ctor-default 1.0 -- a no-op). PORT GUARD: the binary
// calls through the resolved link UNGUARDED (authored topology always links);
// an unlinked port sink supplies 0 instead of faulting.
//
Scalar
HeatSink::DrawCoolant(Scalar /*requested*/)
HeatSink::DrawCoolant(Scalar requested)
{
return 0.0f;
HeatSink *linked = (HeatSink *)linkedSinks.Resolve(); // FUN_00417ab4(this+0x59)
requested *= coolantFlowScale; // @0x15C
if (linked == 0)
return 0.0f;
return linked->DrawCoolant(requested); // vtbl+0x38 (virtual)
}