From 4bede550be18cfc9bb4df669c147032917160066 Mon Sep 17 00:00:00 2001 From: oy Date: Tue, 1 Mar 2011 18:31:20 +0100 Subject: only update the ping if the scoreboard is active. Closes #27 --- src/game/client/components/controls.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/game/client/components/controls.cpp') diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index f7da46b6..479bba22 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "controls.h" @@ -112,19 +113,22 @@ int CControls::SnapInput(int *pData) // update player state if(m_pClient->m_pChat->IsActive()) - m_InputData.m_PlayerState = PLAYERSTATE_CHATTING; + m_InputData.m_PlayerFlags = PLAYERFLAG_CHATTING; else if(m_pClient->m_pMenus->IsActive()) - m_InputData.m_PlayerState = PLAYERSTATE_IN_MENU; + m_InputData.m_PlayerFlags = PLAYERFLAG_IN_MENU; else - m_InputData.m_PlayerState = PLAYERSTATE_PLAYING; + m_InputData.m_PlayerFlags = PLAYERFLAG_PLAYING; - if(m_LastData.m_PlayerState != m_InputData.m_PlayerState) + if(m_pClient->m_pScoreboard->Active()) + m_InputData.m_PlayerFlags |= PLAYERFLAG_SCOREBOARD; + + if(m_LastData.m_PlayerFlags != m_InputData.m_PlayerFlags) Send = true; - m_LastData.m_PlayerState = m_InputData.m_PlayerState; + m_LastData.m_PlayerFlags = m_InputData.m_PlayerFlags; // we freeze the input if chat or menu is activated - if(m_InputData.m_PlayerState != PLAYERSTATE_PLAYING) + if(!(m_InputData.m_PlayerFlags&PLAYERFLAG_PLAYING)) { OnReset(); @@ -172,7 +176,6 @@ int CControls::SnapInput(int *pData) else if(m_InputData.m_Jump != m_LastData.m_Jump) Send = true; else if(m_InputData.m_Fire != m_LastData.m_Fire) Send = true; else if(m_InputData.m_Hook != m_LastData.m_Hook) Send = true; - else if(m_InputData.m_PlayerState != m_LastData.m_PlayerState) Send = true; else if(m_InputData.m_WantedWeapon != m_LastData.m_WantedWeapon) Send = true; else if(m_InputData.m_NextWeapon != m_LastData.m_NextWeapon) Send = true; else if(m_InputData.m_PrevWeapon != m_LastData.m_PrevWeapon) Send = true; -- cgit 1.4.1