about summary refs log tree commit diff
path: root/src/game/server/gamecontext.cpp
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-03-28 23:45:47 +0200
committeroy <Tom_Adams@web.de>2011-03-28 23:45:47 +0200
commitf9288eb5b15d3ed1dba4856e4a70a55f899c00a0 (patch)
treeec1c59135aa1b95cbda551b4ff6192d1466bb07b /src/game/server/gamecontext.cpp
parent141089f2573d7be7b70d9a187ba855a0f2c756c4 (diff)
downloadzcatch-f9288eb5b15d3ed1dba4856e4a70a55f899c00a0.tar.gz
zcatch-f9288eb5b15d3ed1dba4856e4a70a55f899c00a0.zip
fixed that spectators go to free view if the followed player joins spectators and prevent that you can follow spectators
Diffstat (limited to 'src/game/server/gamecontext.cpp')
-rw-r--r--src/game/server/gamecontext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index d008787a..a50a7ef3 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -803,7 +803,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
 			return;
 
 		pPlayer->m_LastSetSpectatorMode = Server()->Tick();
-		if(pMsg->m_SpectatorID != SPEC_FREEVIEW && !m_apPlayers[pMsg->m_SpectatorID])
+		if(pMsg->m_SpectatorID != SPEC_FREEVIEW && (!m_apPlayers[pMsg->m_SpectatorID] || m_apPlayers[pMsg->m_SpectatorID]->GetTeam() == TEAM_SPECTATORS))
 			SendChatTarget(ClientID, "Invalid spectator id used");
 		else
 			pPlayer->m_SpectatorID = pMsg->m_SpectatorID;