mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Merge pull request #7863 from furo321/hookcoll-inaccurate
Scale angles using MousePos with zoom
This commit is contained in:
commit
739e104fbb
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue