diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index 28c293ba2f2..a83e502b871 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -210,11 +210,11 @@ int CControls::SnapInput(int *pData) // even if chat or menu are activated vec2 Pos = m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy]; const int MaxDistance = g_Config.m_ClDyncam ? g_Config.m_ClDyncamMaxDistance : g_Config.m_ClMouseMaxDistance; - if(MaxDistance > 5) // Only multiply mouse coords if not angle bind + if(!m_pClient->m_Snap.m_SpecInfo.m_Active && MaxDistance > 5) // Only multiply mouse coords if not angle bind { if(g_Config.m_ClImproveMousePrecision && MaxDistance < 1000) // Don't scale if it would reduce precision Pos *= length(Pos) * 1000.0f / (float)MaxDistance; - if(!m_pClient->m_Snap.m_SpecInfo.m_Active && !g_Config.m_ClOldMouseZoom) + if(!g_Config.m_ClOldMouseZoom) Pos *= m_pClient->m_Camera.m_Zoom; } m_aInputData[g_Config.m_ClDummy].m_TargetX = (int)Pos.x; @@ -235,17 +235,15 @@ int CControls::SnapInput(int *pData) m_aMousePosOnAction[g_Config.m_ClDummy] = vec2(0.0f, 0.0f); } else - Pos = m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy]; - if(!m_pClient->m_Snap.m_SpecInfo.m_Active) + + Pos = m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy]; + const int MaxDistance = g_Config.m_ClDyncam ? g_Config.m_ClDyncamMaxDistance : g_Config.m_ClMouseMaxDistance; + if(!m_pClient->m_Snap.m_SpecInfo.m_Active && MaxDistance > 5) // Only multiply mouse coords if not angle bind { - const int MaxDistance = g_Config.m_ClDyncam ? g_Config.m_ClDyncamMaxDistance : g_Config.m_ClMouseMaxDistance; - if(MaxDistance > 5) // Only multiply mouse coords if not angle bind - { - if(g_Config.m_ClImproveMousePrecision && MaxDistance < 1000) // Don't scale if it would reduce precision - Pos *= length(Pos) * 1000.0f / (float)(g_Config.m_ClDyncam ? g_Config.m_ClDyncamMaxDistance : g_Config.m_ClMouseMaxDistance); - if(!g_Config.m_ClOldMouseZoom) - Pos *= m_pClient->m_Camera.m_Zoom; - } + if(g_Config.m_ClImproveMousePrecision && MaxDistance < 1000) // Don't scale if it would reduce precision + Pos *= length(Pos) * 1000.0f / (float)(g_Config.m_ClDyncam ? g_Config.m_ClDyncamMaxDistance : g_Config.m_ClMouseMaxDistance); + if(!g_Config.m_ClOldMouseZoom) + Pos *= m_pClient->m_Camera.m_Zoom; } m_aInputData[g_Config.m_ClDummy].m_TargetX = (int)Pos.x; m_aInputData[g_Config.m_ClDummy].m_TargetY = (int)Pos.y;