mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fix local hookline direction when mouse is exactly center
This commit is contained in:
parent
0157deae61
commit
712b3f041d
|
@ -138,8 +138,13 @@ void CPlayers::RenderHookCollLine(
|
|||
vec2 ExDirection = Direction;
|
||||
|
||||
if(Local && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
{
|
||||
ExDirection = normalize(vec2((int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].x, (int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].y));
|
||||
|
||||
// fix direction if mouse is exactly in the center
|
||||
if(!(int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].x && !(int)m_pClient->m_Controls.m_MousePos[g_Config.m_ClDummy].y)
|
||||
ExDirection = vec2(1, 0);
|
||||
}
|
||||
Graphics()->TextureClear();
|
||||
vec2 InitPos = Position;
|
||||
vec2 FinishPos = InitPos + ExDirection * (m_pClient->m_Tuning[g_Config.m_ClDummy].m_HookLength - 42.0f);
|
||||
|
|
Loading…
Reference in a new issue