diff --git a/game/reconstructed/mech2.cpp b/game/reconstructed/mech2.cpp index ea85219..152643b 100644 --- a/game/reconstructed/mech2.cpp +++ b/game/reconstructed/mech2.cpp @@ -693,8 +693,17 @@ Scalar distance = 0.0f; break; } - if (mppr == 0 - || (mppr->turnDemand <= 0.05f && mppr->turnDemand >= -0.05f)) + // MASTER ONLY (regression fix): the master-perf turn-stop exit is master-perf + // logic (FUN_004a9b5c runs on MasterInstance mechs, NOT replicants). A replicant + // derives turnDemand from the REPLICATED yaw rate (mech4.cpp:1968) -- a noisy + // proxy that dips into the deadband between dead-reckon updates; running this + // exit on it kicked the peer out of trn every few frames -> the peer "rotated as + // a statue" + jerky (user-reported). Gate to masters; a replicant leaves trn via + // the speed exits + its own turnDemand-driven re-entry, exactly as it did before + // this exit was added. + if (GetInstance() != ReplicantInstance + && (mppr == 0 + || (mppr->turnDemand <= 0.05f && mppr->turnDemand >= -0.05f))) { legStateAlarm.SetLevel(0); // turn stopped -> Standing (master-perf exit) ForceUpdate(8); @@ -932,8 +941,9 @@ Scalar distance = 0.0f; break; } - if (bm == 0 - || (bm->turnDemand <= 0.05f && bm->turnDemand >= -0.05f)) + if (GetInstance() != ReplicantInstance // MASTER only (see leg twin) + && (bm == 0 + || (bm->turnDemand <= 0.05f && bm->turnDemand >= -0.05f))) { bodyStateAlarm.SetLevel(0); // turn stopped (leg-symmetric) ForceUpdate(8); diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index 3d5cdf8..354598a 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -1988,6 +1988,19 @@ void legCycleSpeed = 0.0f; (void)AdvanceLegAnimation(dt); // joints only; travel = DeadReckon + if (getenv("BT_REPL_TRN")) + { + static float s_rt = 0.0f; s_rt += dt; + if (s_rt >= 0.15f) + { + s_rt = 0.0f; + DEBUG_STREAM << "[repltrn] yawRate=" << yawRate + << " turnDemand=" << replMppr->turnDemand + << " legState=" << (int)legStateAlarm.GetLevel() + << " spd=" << replMppr->speedDemand << "\n" << std::flush; + } + } + // REPLICANT BEAMS (task #51): the emitters carry live replicated // discharge state (Emitter::ReadUpdateRecord); draw them with the // same per-weapon walk the master uses.