Respawn visuals: warp was in the wrong render pass; render never un-wrecked

Two render bugs behind "warp never appears" + "respawned mech stays a sunk wreck":

1. Warp invisible: the tsphere was drawn in PASS_ALPHABLEND, but DrawMesh skips
   any op whose alphaTest != (pass==PASS_ALPHABLEND) (L4D3D.cpp:1045) and
   tsphere's op is opaque -> every op skipped, nothing drawn. Flag the sphere's
   ops for the alpha pass, and draw it as an explicit translucent-blue ADDITIVE
   glow (state saved+restored) so it reads as a warp shimmer, not an opaque ball
   or (as shipped) nothing. Tint via BT_WARP_COLOR.

2. Render stays wrecked on respawn: SwapToWreck hides the body + hangs a sinking
   dbr hulk with render_tree.wrecked a one-way latch; Mech::Reset healed the sim
   but nothing reversed the render, so the reborn mech kept rendering as the sunk
   hulk. Add RebuildMechRenderables (the heal direction of RemakeEntity): drop the
   hulk/debris, clear wrecked, restore every body segment to its now-intact mesh.
   Mech::Reset calls it via BTRebuildMechModel.

Smoke-verified: tsphere loads with its op alpha-flagged; on each respawn
"[BTrender] respawn: rebuilt intact model (12 segs restored, hulk dropped)"; no
crash. Both are local render (the respawning node's own screen); remote-observer
replication of the warp+un-wreck rides the deferred WriteUpdateRecord death path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-10 07:26:48 -05:00
co-authored by Claude Opus 4.8
parent 247e51e1e1
commit d07dd0bf4e
3 changed files with 179 additions and 1 deletions
+8
View File
@@ -1066,6 +1066,14 @@ void
SetPreRunFlag();
if (interestCount == 0) interestCount = 1;
// --- RENDER un-wreck: drop the sunk dbr hulk + restore the intact body ---
// (the wreck swap is one-way on the render side; Reset heals the sim but
// the mech keeps rendering as the sunk hulk without this).
{
extern void BTRebuildMechModel(Entity *entity);
BTRebuildMechModel((Entity *)this);
}
// --- broadcast the reset state to replicants (FUN_004a4c54(this, 0x1f)) ---
ForceUpdate();