Skip to content

Commit

Permalink
Handle input reset on chat correctly on DDNet servers and other servers
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Jul 10, 2017
1 parent bcb30c8 commit 8b5ee98
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/game/client/components/controls.cpp
Expand Up @@ -217,7 +217,16 @@ int CControls::SnapInput(int *pData)
else if(m_pClient->m_pMenus->IsActive())
m_InputData[g_Config.m_ClDummy].m_PlayerFlags = PLAYERFLAG_IN_MENU;
else
{
if(m_InputData[g_Config.m_ClDummy].m_PlayerFlags != PLAYERFLAG_PLAYING)
{
CServerInfo Info;
GameClient()->Client()->GetServerInfo(&Info);
if(IsDDNet(&Info))
ResetInput(g_Config.m_ClDummy);
}
m_InputData[g_Config.m_ClDummy].m_PlayerFlags = PLAYERFLAG_PLAYING;
}

if(m_pClient->m_pScoreboard->Active())
m_InputData[g_Config.m_ClDummy].m_PlayerFlags |= PLAYERFLAG_SCOREBOARD;
Expand All @@ -236,7 +245,10 @@ int CControls::SnapInput(int *pData)
// we freeze the input if chat or menu is activated
if(!(m_InputData[g_Config.m_ClDummy].m_PlayerFlags&PLAYERFLAG_PLAYING))
{
ResetInput(g_Config.m_ClDummy);
CServerInfo Info;
GameClient()->Client()->GetServerInfo(&Info);
if(!IsDDNet(&Info))
ResetInput(g_Config.m_ClDummy);

mem_copy(pData, &m_InputData[g_Config.m_ClDummy], sizeof(m_InputData[0]));

Expand Down

0 comments on commit 8b5ee98

Please sign in to comment.