diff options
| author | oy <Tom_Adams@web.de> | 2011-08-04 23:43:39 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-08-05 19:52:38 +0200 |
| commit | 2b2ddde04f3d61b09129f944387279906c73f6a4 (patch) | |
| tree | f1844f47869f5ffb44fb33dd2c94fd5d21c95bd7 /src/game/client/gameclient.cpp | |
| parent | e5395f00b39b6a7e1beca405c33c6155e83d3b5a (diff) | |
| download | zcatch-2b2ddde04f3d61b09129f944387279906c73f6a4.tar.gz zcatch-2b2ddde04f3d61b09129f944387279906c73f6a4.zip | |
sort players in kick/move to spec vote and player options by team. Closes #809
Diffstat (limited to 'src/game/client/gameclient.cpp')
| -rw-r--r-- | src/game/client/gameclient.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 7b6b1192..d110bfe7 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -862,6 +862,17 @@ void CGameClient::OnNewSnapshot() } } } + // sort player infos by team + int Teams[3] = { TEAM_RED, TEAM_BLUE, TEAM_SPECTATORS }; + int Index = 0; + for(int Team = 0; Team < 3; ++Team) + { + for(int i = 0; i < MAX_CLIENTS && Index < MAX_CLIENTS; ++i) + { + if(m_Snap.m_paPlayerInfos[i] && m_Snap.m_paPlayerInfos[i]->m_Team == Teams[Team]) + m_Snap.m_paInfoByTeam[Index++] = m_Snap.m_paPlayerInfos[i]; + } + } CTuningParams StandardTuning; CServerInfo CurrentServerInfo; |