From 622b3de9bd224dca8c55ea6ab7b12d05dc30e705 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 4 Apr 2011 10:42:36 +0200 Subject: Added more convenient variabe names for sectate_next and spectator_previous --- src/game/client/components/spectator.cpp | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/game') diff --git a/src/game/client/components/spectator.cpp b/src/game/client/components/spectator.cpp index b3bdff7c..94889de7 100644 --- a/src/game/client/components/spectator.cpp +++ b/src/game/client/components/spectator.cpp @@ -30,8 +30,8 @@ void CSpectator::ConSpectate(IConsole::IResult *pResult, void *pUserData) void CSpectator::ConSpectateNext(IConsole::IResult *pResult, void *pUserData) { CSpectator *pSelf = (CSpectator *)pUserData; - int SelectedSpectator; - bool GotNewPlayer = false; + int NewSpectatorID; + bool GotNewSpectatorID = false; if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) { @@ -40,8 +40,8 @@ void CSpectator::ConSpectateNext(IConsole::IResult *pResult, void *pUserData) if(!pSelf->m_pClient->m_Snap.m_paPlayerInfos[i] || pSelf->m_pClient->m_Snap.m_paPlayerInfos[i]->m_Team == TEAM_SPECTATORS) continue; - SelectedSpectator = i; - GotNewPlayer = true; + NewSpectatorID = i; + GotNewSpectatorID = true; break; } } @@ -52,33 +52,33 @@ void CSpectator::ConSpectateNext(IConsole::IResult *pResult, void *pUserData) if(!pSelf->m_pClient->m_Snap.m_paPlayerInfos[i] || pSelf->m_pClient->m_Snap.m_paPlayerInfos[i]->m_Team == TEAM_SPECTATORS) continue; - SelectedSpectator = i; - GotNewPlayer = true; + NewSpectatorID = i; + GotNewSpectatorID = true; break; } - if(!GotNewPlayer) + if(!GotNewSpectatorID) { for(int i = 0; i < pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID; i++) { if(!pSelf->m_pClient->m_Snap.m_paPlayerInfos[i] || pSelf->m_pClient->m_Snap.m_paPlayerInfos[i]->m_Team == TEAM_SPECTATORS) continue; - SelectedSpectator = i; - GotNewPlayer = true; + NewSpectatorID = i; + GotNewSpectatorID = true; break; } } } - if(GotNewPlayer) - pSelf->Spectate(SelectedSpectator); + if(GotNewSpectatorID) + pSelf->Spectate(NewSpectatorID); } void CSpectator::ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData) { CSpectator *pSelf = (CSpectator *)pUserData; - int SelectedSpectator; - bool GotNewPlayer = false; + int NewSpectatorID; + bool GotNewSpectatorID = false; if(pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID == SPEC_FREEVIEW) { @@ -87,8 +87,8 @@ void CSpectator::ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData if(!pSelf->m_pClient->m_Snap.m_paPlayerInfos[i] || pSelf->m_pClient->m_Snap.m_paPlayerInfos[i]->m_Team == TEAM_SPECTATORS) continue; - SelectedSpectator = i; - GotNewPlayer = true; + NewSpectatorID = i; + GotNewSpectatorID = true; break; } } @@ -99,26 +99,26 @@ void CSpectator::ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData if(!pSelf->m_pClient->m_Snap.m_paPlayerInfos[i] || pSelf->m_pClient->m_Snap.m_paPlayerInfos[i]->m_Team == TEAM_SPECTATORS) continue; - SelectedSpectator = i; - GotNewPlayer = true; + NewSpectatorID = i; + GotNewSpectatorID = true; break; } - if(!GotNewPlayer) + if(!GotNewSpectatorID) { for(int i = MAX_CLIENTS - 1; i > pSelf->m_pClient->m_Snap.m_SpecInfo.m_SpectatorID; i--) { if(!pSelf->m_pClient->m_Snap.m_paPlayerInfos[i] || pSelf->m_pClient->m_Snap.m_paPlayerInfos[i]->m_Team == TEAM_SPECTATORS) continue; - SelectedSpectator = i; - GotNewPlayer = true; + NewSpectatorID = i; + GotNewSpectatorID = true; break; } } } - if(GotNewPlayer) - pSelf->Spectate(SelectedSpectator); + if(GotNewSpectatorID) + pSelf->Spectate(NewSpectatorID); } CSpectator::CSpectator() -- cgit 1.4.1