From 530bbeb959e8405dd2fd0384390d579685d59200 Mon Sep 17 00:00:00 2001 From: arcattack Date: Tue, 14 Jul 2026 08:46:00 -0500 Subject: [PATCH] Fix BT_SPAWN_AT terrain embed + add BT_COOL_LOG probe BT_SPAWN_AT teleport set only X/Z, keeping the old (dropzone) Y -- so teleporting to a new spot embedded the mech in sloped terrain (user-reported). Lift the teleport +500 above the old elevation so the authentic per-frame ground SNAP (BoxTree FindBoundingBoxUnder, no gravity) settles it onto the surface next frame (the snap only lowers, so it must start above the surface). Diagnostic only. Also BT_COOL_LOG (heat.cpp): logs a heat subsystem's damageLevel/heatLoad/coolantDraw when it carries damage -- for the 'do damaged mechs leak coolant' investigation. Co-Authored-By: Claude Fable 5 --- game/reconstructed/heat.cpp | 9 +++++++++ game/reconstructed/mech4.cpp | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/game/reconstructed/heat.cpp b/game/reconstructed/heat.cpp index e79fcd4..c373d2b 100644 --- a/game/reconstructed/heat.cpp +++ b/game/reconstructed/heat.cpp @@ -818,6 +818,15 @@ void coolantDraw = 0.0f; } + // DIAG (BT_COOL_LOG): fire whenever THIS heat subsystem carries any damage -- + // answers "does damaging a mech drain its coolant?". Shows the damageLevel the + // leak reads (@0xE0), the heat load, the resulting draw, and the live level. + if (getenv("BT_COOL_LOG") && zoneDamage > 0.001f) + DEBUG_STREAM << "[cool] " << GetName() << " dmg=" << zoneDamage + << " heatLoad=" << heatLoad << " draw=" << coolantDraw + << " coolantLevel=" << coolantLevel << "/" << thermalCapacity + << "\n" << std::flush; + Scalar amount = coolantDraw * time_slice; if (coolantLevel < amount) { diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index 5f84b27..3d5cdf8 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -2376,6 +2376,13 @@ void s_spawnAt = 2; localOrigin.linearPosition.x = s_sx; localOrigin.linearPosition.z = s_sz; + // FIX (user-reported: teleport embeds the mech in sloped terrain): + // BT_SPAWN_AT set only X/Z, keeping the OLD (dropzone) Y -- wrong for + // the new ground height. Lift the mech WELL ABOVE local terrain so the + // authentic per-frame ground SNAP (BoxTree FindBoundingBoxUnder, no + // gravity) settles it onto the surface next frame. The snap only + // lowers, so it must start above the surface, not below. + localOrigin.linearPosition.y += 500.0f; if (s_haveH) { gDriveHeading = s_sh;