about summary refs log tree commit diff
path: root/src/game/client/components/scoreboard.cpp
diff options
context:
space:
mode:
authorTom Adams <Tom_Adams@web.de>2010-05-29 23:57:30 +0000
committerTom Adams <Tom_Adams@web.de>2010-05-29 23:57:30 +0000
commitbaa57830ad5fb186875532b19d4c043572465881 (patch)
treef06ac613f5fa8adb6a0fa1d012b6169b6e9b7140 /src/game/client/components/scoreboard.cpp
parente16fdc3f3edc4f66cda9a44679af2ebe1b235612 (diff)
downloadzcatch-baa57830ad5fb186875532b19d4c043572465881.tar.gz
zcatch-baa57830ad5fb186875532b19d4c043572465881.zip
fixed bubble sort loop (#802), 2 entries in the language files and a possible overrun
Diffstat (limited to 'src/game/client/components/scoreboard.cpp')
-rw-r--r--src/game/client/components/scoreboard.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp
index b7e8aa9a..80330e9c 100644
--- a/src/game/client/components/scoreboard.cpp
+++ b/src/game/client/components/scoreboard.cpp
@@ -166,13 +166,14 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
 			if(pInfo->m_Team == Team)
 			{
 				paPlayers[NumPlayers] = pInfo;
-				NumPlayers++;
+				if(++NumPlayers == MAX_CLIENTS)
+					break;
 			}
 		}
 	}
 
 	// sort players
-	for(int k = 0; k < NumPlayers; k++) // ffs, bubblesort
+	for(int k = 0; k < NumPlayers-1; k++) // ffs, bubblesort
 	{
 		for(int i = 0; i < NumPlayers-k-1; i++)
 		{