about summary refs log tree commit diff
path: root/src/game/client/components/controls.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-03-01 18:31:20 +0100
committeroy <Tom_Adams@web.de>2011-03-01 18:31:20 +0100
commit4bede550be18cfc9bb4df669c147032917160066 (patch)
tree56652609b0a47df5e1cf27abbbaf8a3d5cf9756d /src/game/client/components/controls.cpp
parent0bc13c91ebcc6404fc67e079e5a9acad10176c98 (diff)
downloadzcatch-4bede550be18cfc9bb4df669c147032917160066.tar.gz
zcatch-4bede550be18cfc9bb4df669c147032917160066.zip
only update the ping if the scoreboard is active. Closes #27
Diffstat (limited to 'src/game/client/components/controls.cpp')
-rw-r--r--src/game/client/components/controls.cpp17
1 files changed, 10 insertions, 7 deletions
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 <game/client/component.h>
 #include <game/client/components/chat.h>
 #include <game/client/components/menus.h>
+#include <game/client/components/scoreboard.h>
 
 #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;