From baa57830ad5fb186875532b19d4c043572465881 Mon Sep 17 00:00:00 2001 From: Tom Adams Date: Sat, 29 May 2010 23:57:30 +0000 Subject: fixed bubble sort loop (#802), 2 entries in the language files and a possible overrun --- src/game/client/components/scoreboard.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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++) { -- cgit 1.4.1