diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index 5aef0085f..45cf340b3 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -504,17 +504,16 @@ void CControls::ClampMousePos() else { float CameraMaxDistance = 200.0f; - float CameraMinDistance = 0.0f; float FollowFactor = (g_Config.m_ClDyncam ? g_Config.m_ClDyncamFollowFactor : g_Config.m_ClMouseFollowfactor) / 100.0f; float DeadZone = g_Config.m_ClDyncam ? g_Config.m_ClDyncamDeadzone : g_Config.m_ClMouseDeadzone; float MaxDistance = g_Config.m_ClDyncam ? g_Config.m_ClDyncamMaxDistance : g_Config.m_ClMouseMaxDistance; - float MouseMax = minimum(CameraMaxDistance/FollowFactor + DeadZone, MaxDistance); + float MouseMax = minimum((FollowFactor != 0 ? CameraMaxDistance/FollowFactor + DeadZone : MaxDistance), MaxDistance); float MinDistance = g_Config.m_ClDyncam ? g_Config.m_ClDyncamMinDistance : g_Config.m_ClMouseMinDistance; - float MouseMin = minimum(CameraMinDistance/FollowFactor + DeadZone, MinDistance); + float MouseMin = MinDistance; - if(length(m_MousePos[g_Config.m_ClDummy]) > MouseMax) - m_MousePos[g_Config.m_ClDummy] = normalize(m_MousePos[g_Config.m_ClDummy])*MouseMax; if(length(m_MousePos[g_Config.m_ClDummy]) < MouseMin) m_MousePos[g_Config.m_ClDummy] = normalize(m_MousePos[g_Config.m_ClDummy])*MouseMin; + if(length(m_MousePos[g_Config.m_ClDummy]) > MouseMax) + m_MousePos[g_Config.m_ClDummy] = normalize(m_MousePos[g_Config.m_ClDummy])*MouseMax; } }