diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index bf12aeafe..af57a1e29 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -1448,19 +1448,19 @@ void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlIn // set up variables int const running = !!(inputBuffer->actions & SB_RUN); int const keymove = gi->playerKeyMove() << running; - int const mousevelscale = g_gameType & GAMEFLAG_BLOOD ? 32 : 4; int const cntrlvelscale = g_gameType & GAMEFLAG_PSEXHUMED ? 8 : 1; + float const mousevelscale = keymove / 160.f; // process mouse and initial controller input. if (buttonMap.ButtonDown(gamefunc_Strafe) && allowstrafe) - currInput->svel -= xs_CRoundToInt((hidInput->mousemovex * mousevelscale) + (scaleAdjust * (hidInput->dyaw / 60) * keymove * cntrlvelscale)); + currInput->svel -= xs_CRoundToInt(hidInput->mousemovex * mousevelscale + (scaleAdjust * (hidInput->dyaw / 60) * keymove * cntrlvelscale)); else currInput->q16avel += FloatToFixed(hidInput->mouseturnx + (scaleAdjust * hidInput->dyaw)); if (!(inputBuffer->actions & SB_AIMMODE)) currInput->q16horz -= FloatToFixed(hidInput->mouseturny); else - currInput->fvel -= xs_CRoundToInt(hidInput->mousemovey * mousevelscale * 2); + currInput->fvel -= xs_CRoundToInt(hidInput->mousemovey * mousevelscale); if (invertmouse) currInput->q16horz = -currInput->q16horz; @@ -1496,8 +1496,7 @@ void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlIn // allow Exhumed to use its legacy values given the drastic difference from the other games. if ((g_gameType & GAMEFLAG_PSEXHUMED) && cl_exhumedoldturn) { - turnamount = running ? 12 : 8; - preambleturn = turnamount; + preambleturn = turnamount = running ? 12 : 8; } if (buttonMap.ButtonDown(gamefunc_Turn_Left) || (buttonMap.ButtonDown(gamefunc_Strafe_Left) && !allowstrafe)) diff --git a/source/core/inputstate.cpp b/source/core/inputstate.cpp index 7df8d1c5a..fd8f6f55d 100644 --- a/source/core/inputstate.cpp +++ b/source/core/inputstate.cpp @@ -62,14 +62,12 @@ CVAR(Float, m_side, 1.f, CVAR_GLOBALCONFIG | CVAR_ARCHIVE) void InputState::GetMouseDelta(ControlInfo * hidInput) { - vec2f_t finput = g_mousePos; + hidInput->mouseturnx = g_mousePos.x * m_yaw * (1.f / 4.f); + hidInput->mouseturny = g_mousePos.y * m_pitch * (1.f / 8.f); + hidInput->mousemovex = g_mousePos.x * m_side; + hidInput->mousemovey = g_mousePos.y * m_forward; + g_mousePos = {}; - - hidInput->mouseturnx = finput.x * m_yaw * (1.f / 3.f); - hidInput->mouseturny = finput.y * m_pitch * 0.5f; - - hidInput->mousemovex = finput.x * m_side* (1.f / 3.f); - hidInput->mousemovey = finput.y * m_forward * 0.5f; } //==========================================================================