diff --git a/game/reconstructed/mech4.cpp b/game/reconstructed/mech4.cpp index d8b8ef2..7b74199 100644 --- a/game/reconstructed/mech4.cpp +++ b/game/reconstructed/mech4.cpp @@ -2148,6 +2148,24 @@ void // master's exact clips. Swapping the peer to the body channel RESTORES the // original single-channel design (no new netcode). BT_PEER_LEGCH=1 = old. static const int s_peerLegCh = getenv("BT_PEER_LEGCH") ? 1 : 0; + // TURN-STEP ARMING for the body channel: the body Standing case only enters + // walk/reverse/stand -- it never arms the turn-in-place clip (state 4); on the + // master that arming comes from the LEG Standing case cross-arming both + // channels (mech2.cpp:937 note), which the peer no longer runs. Arm/exit the + // body turn state here from the replicated turn (replMppr->turnDemand, from the + // replicated yaw rate + hysteresis above): standing + turning -> state 4 (body + // case 4 then advances the trn clip -> the peer STEPS through the pivot); turn + // stops -> back to Standing. Walk/reverse transitions still own their exits. + if (!s_peerLegCh) + { + const int bs = (int)bodyStateAlarm.GetLevel(); + const bool turning = (replMppr->turnDemand > 0.05f + || replMppr->turnDemand < -0.05f); + if (turning && bs == 0) // standing + turning -> enter turn + SetBodyAnimation(4); + else if (!turning && bs == 4) // turn stopped -> back to stand + SetBodyAnimation(0); + } const Scalar replLegAdv = s_peerLegCh ? AdvanceLegAnimation(dt) // old: re-derived leg SM : AdvanceBodyAnimation(dt, 1); // authentic: body channel, mj=1 poses skeleton