about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-01-17 13:42:40 +0100
committeroy <Tom_Adams@web.de>2011-01-17 13:42:40 +0100
commit813f0797d8b47135df3c4448bf4df3272bdc12d7 (patch)
treef7d246836e6cec35c1e0d116dbe7e2cc82a9ba3b /src/game
parentbf6fcc20f4a9cccab0470d5848a2401bd0bfe93e (diff)
downloadzcatch-813f0797d8b47135df3c4448bf4df3272bdc12d7.tar.gz
zcatch-813f0797d8b47135df3c4448bf4df3272bdc12d7.zip
fixed scoreboard active check. Closes #423
Diffstat (limited to 'src/game')
-rw-r--r--src/game/client/components/scoreboard.cpp39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp
index 5fb2395f..afc87ef8 100644
--- a/src/game/client/components/scoreboard.cpp
+++ b/src/game/client/components/scoreboard.cpp
@@ -265,24 +265,7 @@ void CScoreboard::RenderRecordingNotification(float x)
 
 void CScoreboard::OnRender()
 {
-	bool DoScoreBoard = false;
-
-	// if we activly wanna look on the scoreboard	
-	if(m_Active)
-		DoScoreBoard = true;
-		
-	if(m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS)
-	{
-		// we are not a spectator, check if we are ead
-		if(!m_pClient->m_Snap.m_pLocalCharacter || m_pClient->m_Snap.m_pLocalCharacter->m_Health < 0)
-			DoScoreBoard = true;
-	}
-
-	// if we the game is over
-	if(m_pClient->m_Snap.m_pGameobj && m_pClient->m_Snap.m_pGameobj->m_GameOver)
-		DoScoreBoard = true;
-		
-	if(!DoScoreBoard)
+	if(!Active())
 		return;
 		
 	// if the score board is active, then we should clear the motd message aswell
@@ -298,10 +281,7 @@ void CScoreboard::OnRender()
 	float w = 650.0f;
 
 	if(m_pClient->m_Snap.m_pGameobj && !(m_pClient->m_Snap.m_pGameobj->m_Flags&GAMEFLAG_TEAMS))
-	{
 		RenderScoreboard(Width/2-w/2, 150.0f, w, 0, 0);
-		//render_scoreboard(gameobj, 0, 0, -1, 0);
-	}
 	else
 	{
 			
@@ -328,5 +308,20 @@ void CScoreboard::OnRender()
 
 bool CScoreboard::Active()
 {
-	return m_Active | (m_pClient->m_Snap.m_pGameobj && m_pClient->m_Snap.m_pGameobj->m_GameOver);
+	// if we activly wanna look on the scoreboard	
+	if(m_Active)
+		return true;
+		
+	if(m_pClient->m_Snap.m_pLocalInfo && m_pClient->m_Snap.m_pLocalInfo->m_Team != TEAM_SPECTATORS)
+	{
+		// we are not a spectator, check if we are dead
+		if(!m_pClient->m_Snap.m_pLocalCharacter || m_pClient->m_Snap.m_pLocalCharacter->m_Health <= 0)
+			return true;
+	}
+
+	// if the game is over
+	if(m_pClient->m_Snap.m_pGameobj && m_pClient->m_Snap.m_pGameobj->m_GameOver)
+		return true;
+
+	return false;
 }