diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index 8307d96b6..d3ecd25de 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -280,7 +280,7 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN)) DoPlayerTurn(pp, !TEST(pp->Flags, PF_DEAD) || TEST(pp->Flags, PF_DEAD) && TEST(pp->Flags, PF_DEAD_HEAD|PF_HEAD_CONTROL) ? q16avel : 0, scaleAdjust); if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM)) - DoPlayerHorizon(pp, q16horz, scaleAdjust); + DoPlayerHorizon(pp, !TEST(pp->Flags, PF_DEAD) ? q16horz : 0, scaleAdjust); } loc.fvel = clamp(loc.fvel + fvel, -MAXFVEL, MAXFVEL); diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index bdecf262d..4a83201d1 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -1936,6 +1936,11 @@ DoPlayerHorizon(PLAYERp pp, fixed_t const q16horz, double const scaleAdjust) // add base and offsets pp->q16horiz = pp->q16horizbase + pp->q16horizoff; + + if (!cl_syncinput) + { + pp->q16horiz += xs_CRoundToInt(scaleAdjust * pp->horizAdjust); + } } void @@ -6288,24 +6293,30 @@ DoPlayerBeginDie(PLAYERp pp) RESET(pp->Flags, PF_HEAD_CONTROL); } -int +void DoPlayerDeathHoriz(PLAYERp pp, short target, short speed) { if (pp->q16horiz > IntToFixed(target)) - { - pp->q16horiz -= IntToFixed(speed); + { + if (!cl_syncinput) + SET(pp->Flags2, PF2_INPUT_CAN_AIM); + + playerAddHoriz(pp, -speed); + if (pp->q16horiz <= IntToFixed(target)) - pp->q16horiz = IntToFixed(target); + playerSetHoriz(pp, target); } if (pp->q16horiz < IntToFixed(target)) { - pp->q16horiz += IntToFixed(speed); - if (pp->q16horiz >= IntToFixed(target)) - pp->q16horiz = IntToFixed(target); - } + if (!cl_syncinput) + SET(pp->Flags2, PF2_INPUT_CAN_AIM); - return pp->q16horiz == IntToFixed(target); + playerAddHoriz(pp, speed); + + if (pp->q16horiz >= IntToFixed(target)) + playerSetHoriz(pp, target); + } } int