about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorxalduin <xalduin@gmail.com>2010-06-03 10:35:18 -0400
committerxalduin <xalduin@gmail.com>2010-06-03 10:35:18 -0400
commit3fff61d24aebd77dc6feb289595620e114730c86 (patch)
tree963c4281803ca09e21f07b3fbe256c7f3869d1e8 /src/game/server
parent6baadea5e1319ee35511bddbe1bcca36834e3fb4 (diff)
downloadzcatch-3fff61d24aebd77dc6feb289595620e114730c86.tar.gz
zcatch-3fff61d24aebd77dc6feb289595620e114730c86.zip
Issue #86, don't reset score on team switch
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/player.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp
index 8e58b7c1..354b8118 100644
--- a/src/game/server/player.cpp
+++ b/src/game/server/player.cpp
@@ -156,9 +156,11 @@ void CPlayer::SetTeam(int Team)
 	GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Buf); 
 	
 	KillCharacter();
+	if( m_Team != -1 )	// Give a point to make up for killing character, but not if they're a spectator
+		m_Score += 1;
+
 	m_Team = Team;
-	m_Score = 0;
-	m_ScoreStartTick = Server()->Tick();
+	//m_ScoreStartTick = Server()->Tick();
 	// we got to wait 0.5 secs before respawning
 	m_RespawnTick = Server()->Tick()+Server()->TickSpeed()/2;
 	dbg_msg("game", "team_join player='%d:%s' m_Team=%d", m_ClientID, Server()->ClientName(m_ClientID), m_Team);