From e14123164bed7fe61d3cb8d0a25398aacda2d17d Mon Sep 17 00:00:00 2001 From: furo Date: Fri, 26 Jan 2024 23:12:47 +0100 Subject: [PATCH] Scale angles using MousePos with zoom --- src/game/client/components/players.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 8e85930d2..38d137137 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -139,7 +139,7 @@ void CPlayers::RenderHookCollLine( if(Local && (!m_pClient->m_Snap.m_SpecInfo.m_Active || m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) && Client()->State() != IClient::STATE_DEMOPLAYBACK) { // just use the direct input if it's the local player we are rendering - Angle = angle(m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy]); + Angle = angle(m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy] * m_pClient->m_Camera.m_Zoom); } else { @@ -169,7 +169,9 @@ void CPlayers::RenderHookCollLine( if(Local && (!m_pClient->m_Snap.m_SpecInfo.m_Active || m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) && Client()->State() != IClient::STATE_DEMOPLAYBACK) { - ExDirection = normalize(vec2((int)m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy].x, (int)m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy].y)); + ExDirection = normalize( + vec2((int)((int)m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy].x * m_pClient->m_Camera.m_Zoom), + (int)((int)m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy].y * m_pClient->m_Camera.m_Zoom))); // fix direction if mouse is exactly in the center if(!(int)m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy].x && !(int)m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy].y) @@ -390,7 +392,7 @@ void CPlayers::RenderPlayer( if(Local && (!m_pClient->m_Snap.m_SpecInfo.m_Active || m_pClient->m_Snap.m_SpecInfo.m_SpectatorID != SPEC_FREEVIEW) && Client()->State() != IClient::STATE_DEMOPLAYBACK) { // just use the direct input if it's the local player we are rendering - Angle = angle(m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy]); + Angle = angle(m_pClient->m_Controls.m_aMousePos[g_Config.m_ClDummy] * m_pClient->m_Camera.m_Zoom); } else {