Sort spectator view by team, then name (not score) (fixes #2808)

This commit is contained in:
def 2020-09-13 21:20:13 +02:00
parent 5228473ec9
commit 3832d948bd
4 changed files with 53 additions and 44 deletions

View file

@ -330,7 +330,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
for(int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
{ {
// make sure that we render the correct team // make sure that we render the correct team
const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByDDTeam[i]; const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByDDTeamScore[i];
if(!pInfo || pInfo->m_Team != Team) if(!pInfo || pInfo->m_Team != Team)
continue; continue;
@ -341,7 +341,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
for(int j = i + 1; j < MAX_CLIENTS; j++) for(int j = i + 1; j < MAX_CLIENTS; j++)
{ {
const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeam[j]; const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeamScore[j];
if(!pInfo2 || pInfo2->m_Team != Team) if(!pInfo2 || pInfo2->m_Team != Team)
continue; continue;
@ -354,7 +354,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
{ {
for (int j = i - 1; j >= 0; j--) for (int j = i - 1; j >= 0; j--)
{ {
const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeam[j]; const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeamScore[j];
if(!pInfo2 || pInfo2->m_Team != Team) if(!pInfo2 || pInfo2->m_Team != Team)
continue; continue;

View file

@ -40,18 +40,18 @@ void CSpectator::ConSpectateNext(IConsole::IResult *pResult, void *pUserData)
bool GotNewSpectatorID = false; bool GotNewSpectatorID = false;
int CurPos = -1; int CurPos = -1;
for (int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
if (pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] && pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID == pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID) if(pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] && pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID == pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID)
CurPos = i; CurPos = i;
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
{ {
for(int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
{ {
if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
GotNewSpectatorID = true; GotNewSpectatorID = true;
break; break;
} }
@ -60,10 +60,10 @@ void CSpectator::ConSpectateNext(IConsole::IResult *pResult, void *pUserData)
{ {
for(int i = CurPos + 1; i < MAX_CLIENTS; i++) for(int i = CurPos + 1; i < MAX_CLIENTS; i++)
{ {
if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
GotNewSpectatorID = true; GotNewSpectatorID = true;
break; break;
} }
@ -72,10 +72,10 @@ void CSpectator::ConSpectateNext(IConsole::IResult *pResult, void *pUserData)
{ {
for(int i = 0; i < CurPos; i++) for(int i = 0; i < CurPos; i++)
{ {
if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
GotNewSpectatorID = true; GotNewSpectatorID = true;
break; break;
} }
@ -92,18 +92,18 @@ void CSpectator::ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData
bool GotNewSpectatorID = false; bool GotNewSpectatorID = false;
int CurPos = -1; int CurPos = -1;
for (int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
if (pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] && pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID == pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID) if(pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] && pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID == pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID)
CurPos = i; CurPos = i;
if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW)
{ {
for(int i = MAX_CLIENTS -1; i > -1; i--) for(int i = MAX_CLIENTS -1; i > -1; i--)
{ {
if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
GotNewSpectatorID = true; GotNewSpectatorID = true;
break; break;
} }
@ -112,10 +112,10 @@ void CSpectator::ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData
{ {
for(int i = CurPos - 1; i > -1; i--) for(int i = CurPos - 1; i > -1; i--)
{ {
if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
GotNewSpectatorID = true; GotNewSpectatorID = true;
break; break;
} }
@ -124,11 +124,11 @@ void CSpectator::ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData
{ {
for(int i = MAX_CLIENTS - 1; i > CurPos; i--) for(int i = MAX_CLIENTS - 1; i > CurPos; i--)
{ {
if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; NewSpectatorID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
GotNewSpectatorID = true; GotNewSpectatorID = true;
break; break;
} }
} }
@ -148,10 +148,10 @@ void CSpectator::ConSpectateClosest(IConsole::IResult *pResult, void *pUserData)
{ {
for (int i = 0; i < MAX_CLIENTS; i++) for (int i = 0; i < MAX_CLIENTS; i++)
{ {
if(pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] && pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID == pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID) if(pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] && pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID == pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID)
{ {
IndexOfTeeBeingSpectated = i; IndexOfTeeBeingSpectated = i;
const CNetObj_Character &CurCharacter = pSelf->m_pClient->m_Snap.m_aCharacters[pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_Cur; const CNetObj_Character &CurCharacter = pSelf->m_pClient->m_Snap.m_aCharacters[pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID].m_Cur;
CurPosition.x = CurCharacter.m_X; CurPosition.x = CurCharacter.m_X;
CurPosition.y = CurCharacter.m_Y; CurPosition.y = CurCharacter.m_Y;
break; break;
@ -161,9 +161,9 @@ void CSpectator::ConSpectateClosest(IConsole::IResult *pResult, void *pUserData)
int ClosestDistance = INT_MAX; int ClosestDistance = INT_MAX;
for(int i = 0; i < MAX_CLIENTS; i++) for(int i = 0; i < MAX_CLIENTS; i++)
{ {
if(i == IndexOfTeeBeingSpectated || !pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(i == IndexOfTeeBeingSpectated || !pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i] || pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
int ClientID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; int ClientID = pSelf->m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
const CNetObj_Character &MaybeClosestCharacter = pSelf->m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur; const CNetObj_Character &MaybeClosestCharacter = pSelf->m_pClient->m_Snap.m_aCharacters[ClientID].m_Cur;
int Distance = distance(CurPosition, vec2(MaybeClosestCharacter.m_X, MaybeClosestCharacter.m_Y)); int Distance = distance(CurPosition, vec2(MaybeClosestCharacter.m_X, MaybeClosestCharacter.m_Y));
if(NewSpectatorID == -1 || Distance < ClosestDistance) if(NewSpectatorID == -1 || Distance < ClosestDistance)
@ -246,7 +246,7 @@ void CSpectator::OnRender()
for(int i = 0; i < MAX_CLIENTS; ++i) for(int i = 0; i < MAX_CLIENTS; ++i)
{ {
if(!m_pClient->m_Snap.m_paInfoByDDTeam[i] || m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!m_pClient->m_Snap.m_paInfoByDDTeamName[i] || m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
++TotalPlayers; ++TotalPlayers;
@ -327,7 +327,7 @@ void CSpectator::OnRender()
for(int i = 0, Count = 0; i < MAX_CLIENTS; ++i) for(int i = 0, Count = 0; i < MAX_CLIENTS; ++i)
{ {
if(!m_pClient->m_Snap.m_paInfoByDDTeam[i] || m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_Team == TEAM_SPECTATORS) if(!m_pClient->m_Snap.m_paInfoByDDTeamName[i] || m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_Team == TEAM_SPECTATORS)
continue; continue;
++Count; ++Count;
@ -338,13 +338,13 @@ void CSpectator::OnRender()
y = StartY; y = StartY;
} }
const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByDDTeam[i]; const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByDDTeamName[i];
int DDTeam = m_pClient->m_Teams.Team(pInfo->m_ClientID); int DDTeam = m_pClient->m_Teams.Team(pInfo->m_ClientID);
int NextDDTeam = 0; int NextDDTeam = 0;
for(int j = i + 1; j < MAX_CLIENTS; j++) for(int j = i + 1; j < MAX_CLIENTS; j++)
{ {
const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeam[j]; const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeamName[j];
if(!pInfo2 || pInfo2->m_Team == TEAM_SPECTATORS) if(!pInfo2 || pInfo2->m_Team == TEAM_SPECTATORS)
continue; continue;
@ -357,7 +357,7 @@ void CSpectator::OnRender()
{ {
for (int j = i - 1; j >= 0; j--) for (int j = i - 1; j >= 0; j--)
{ {
const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeam[j]; const CNetObj_PlayerInfo *pInfo2 = m_pClient->m_Snap.m_paInfoByDDTeamName[j];
if(!pInfo2 || pInfo2->m_Team == TEAM_SPECTATORS) if(!pInfo2 || pInfo2->m_Team == TEAM_SPECTATORS)
continue; continue;
@ -388,8 +388,7 @@ void CSpectator::OnRender()
OldDDTeam = DDTeam; OldDDTeam = DDTeam;
if((Client()->State() == IClient::STATE_DEMOPLAYBACK && m_pClient->m_DemoSpecID == m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID) if((Client()->State() == IClient::STATE_DEMOPLAYBACK && m_pClient->m_DemoSpecID == m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID) || (Client()->State() != IClient::STATE_DEMOPLAYBACK && m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID))
|| (Client()->State() != IClient::STATE_DEMOPLAYBACK && m_pClient ->m_Snap.m_SpecInfo.m_SpectatorID == m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID))
{ {
Graphics()->TextureClear(); Graphics()->TextureClear();
Graphics()->QuadsBegin(); Graphics()->QuadsBegin();
@ -402,12 +401,12 @@ void CSpectator::OnRender()
if(m_SelectorMouse.x >= x-10.0f && m_SelectorMouse.x < x+260.0f && if(m_SelectorMouse.x >= x-10.0f && m_SelectorMouse.x < x+260.0f &&
m_SelectorMouse.y >= y-(LineHeight/6.0f) && m_SelectorMouse.y < y+(LineHeight*5.0f/6.0f)) m_SelectorMouse.y >= y-(LineHeight/6.0f) && m_SelectorMouse.y < y+(LineHeight*5.0f/6.0f))
{ {
m_SelectedSpectatorID = m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID; m_SelectedSpectatorID = m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID;
Selected = true; Selected = true;
} }
float TeeAlpha; float TeeAlpha;
if(Client()->State() == IClient::STATE_DEMOPLAYBACK && if(Client()->State() == IClient::STATE_DEMOPLAYBACK &&
!m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_Active) !m_pClient->m_Snap.m_aCharacters[m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID].m_Active)
{ {
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 0.25f); TextRender()->TextColor(1.0f, 1.0f, 1.0f, 0.25f);
TeeAlpha = 0.5f; TeeAlpha = 0.5f;
@ -417,18 +416,17 @@ void CSpectator::OnRender()
TextRender()->TextColor(1.0f, 1.0f, 1.0f, Selected?1.0f:0.5f); TextRender()->TextColor(1.0f, 1.0f, 1.0f, Selected?1.0f:0.5f);
TeeAlpha = 1.0f; TeeAlpha = 1.0f;
} }
TextRender()->Text(0, Width/2.0f+x+50.0f, Height / 2.0f + y + BoxMove + (LineHeight - FontSize) / 2.f, FontSize, m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_aName, 220.0f); TextRender()->Text(0, Width / 2.0f + x + 50.0f, Height / 2.0f + y + BoxMove + (LineHeight - FontSize) / 2.f, FontSize, m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID].m_aName, 220.0f);
// flag // flag
if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags&GAMEFLAG_FLAGS && if(m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags & GAMEFLAG_FLAGS &&
m_pClient->m_Snap.m_pGameDataObj && (m_pClient->m_Snap.m_pGameDataObj->m_FlagCarrierRed == m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID || m_pClient->m_Snap.m_pGameDataObj && (m_pClient->m_Snap.m_pGameDataObj->m_FlagCarrierRed == m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID || m_pClient->m_Snap.m_pGameDataObj->m_FlagCarrierBlue == m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID))
m_pClient->m_Snap.m_pGameDataObj->m_FlagCarrierBlue == m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID))
{ {
Graphics()->BlendNormal(); Graphics()->BlendNormal();
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id); Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
Graphics()->QuadsBegin(); Graphics()->QuadsBegin();
RenderTools()->SelectSprite(m_pClient->m_Snap.m_pGameDataObj->m_FlagCarrierBlue == m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID ? SPRITE_FLAG_BLUE : SPRITE_FLAG_RED, SPRITE_FLAG_FLIP_X); RenderTools()->SelectSprite(m_pClient->m_Snap.m_pGameDataObj->m_FlagCarrierBlue == m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID ? SPRITE_FLAG_BLUE : SPRITE_FLAG_RED, SPRITE_FLAG_FLIP_X);
float Size = LineHeight; float Size = LineHeight;
IGraphics::CQuadItem QuadItem(Width/2.0f+x-LineHeight/5.0f, Height/2.0f+y-LineHeight/3.0f, Size/2.0f, Size); IGraphics::CQuadItem QuadItem(Width/2.0f+x-LineHeight/5.0f, Height/2.0f+y-LineHeight/3.0f, Size/2.0f, Size);
@ -436,7 +434,7 @@ void CSpectator::OnRender()
Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
} }
CTeeRenderInfo TeeInfo = m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeam[i]->m_ClientID].m_RenderInfo; CTeeRenderInfo TeeInfo = m_pClient->m_aClients[m_pClient->m_Snap.m_paInfoByDDTeamName[i]->m_ClientID].m_RenderInfo;
TeeInfo.m_Size *= TeeSizeMod; TeeInfo.m_Size *= TeeSizeMod;
RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1.0f, 0.0f), vec2(Width/2.0f+x+20.0f, Height/2.0f+y+20.0f), TeeAlpha); RenderTools()->RenderTee(CAnimState::GetIdle(), &TeeInfo, EMOTE_NORMAL, vec2(1.0f, 0.0f), vec2(Width/2.0f+x+20.0f, Height/2.0f+y+20.0f), TeeAlpha);

View file

@ -1510,7 +1510,18 @@ void CGameClient::OnNewSnapshot()
for(int i = 0; i < MAX_CLIENTS && Index < MAX_CLIENTS; ++i) for(int i = 0; i < MAX_CLIENTS && Index < MAX_CLIENTS; ++i)
{ {
if(m_Snap.m_paInfoByScore[i] && m_Teams.Team(m_Snap.m_paInfoByScore[i]->m_ClientID) == Team) if(m_Snap.m_paInfoByScore[i] && m_Teams.Team(m_Snap.m_paInfoByScore[i]->m_ClientID) == Team)
m_Snap.m_paInfoByDDTeam[Index++] = m_Snap.m_paInfoByScore[i]; m_Snap.m_paInfoByDDTeamScore[Index++] = m_Snap.m_paInfoByScore[i];
}
}
// sort player infos by DDRace Team (and name between)
Index = 0;
for(int Team = 0; Team <= MAX_CLIENTS; ++Team)
{
for(int i = 0; i < MAX_CLIENTS && Index < MAX_CLIENTS; ++i)
{
if(m_Snap.m_paInfoByName[i] && m_Teams.Team(m_Snap.m_paInfoByName[i]->m_ClientID) == Team)
m_Snap.m_paInfoByDDTeamName[Index++] = m_Snap.m_paInfoByName[i];
} }
} }

View file

@ -190,8 +190,8 @@ public:
const CNetObj_PlayerInfo *m_paPlayerInfos[MAX_CLIENTS]; const CNetObj_PlayerInfo *m_paPlayerInfos[MAX_CLIENTS];
const CNetObj_PlayerInfo *m_paInfoByScore[MAX_CLIENTS]; const CNetObj_PlayerInfo *m_paInfoByScore[MAX_CLIENTS];
const CNetObj_PlayerInfo *m_paInfoByName[MAX_CLIENTS]; const CNetObj_PlayerInfo *m_paInfoByName[MAX_CLIENTS];
//const CNetObj_PlayerInfo *m_paInfoByTeam[MAX_CLIENTS]; const CNetObj_PlayerInfo *m_paInfoByDDTeamScore[MAX_CLIENTS];
const CNetObj_PlayerInfo *m_paInfoByDDTeam[MAX_CLIENTS]; const CNetObj_PlayerInfo *m_paInfoByDDTeamName[MAX_CLIENTS];
int m_LocalClientID; int m_LocalClientID;
int m_NumPlayers; int m_NumPlayers;