From a72848e78032014adb1bf053c4556bf1072b0c2d Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 3 Jan 2011 12:50:38 +0100 Subject: added constants for teams by Choupom --- src/game/server/gamemodes/ctf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game/server/gamemodes/ctf.cpp') diff --git a/src/game/server/gamemodes/ctf.cpp b/src/game/server/gamemodes/ctf.cpp index ad9f8e89..18905dbf 100644 --- a/src/game/server/gamemodes/ctf.cpp +++ b/src/game/server/gamemodes/ctf.cpp @@ -22,8 +22,8 @@ bool CGameControllerCTF::OnEntity(int Index, vec2 Pos) return true; int Team = -1; - if(Index == ENTITY_FLAGSTAND_RED) Team = 0; - if(Index == ENTITY_FLAGSTAND_BLUE) Team = 1; + if(Index == ENTITY_FLAGSTAND_RED) Team = TEAM_RED; + if(Index == ENTITY_FLAGSTAND_BLUE) Team = TEAM_BLUE; if(Team == -1 || m_apFlags[Team]) return false; @@ -142,7 +142,7 @@ void CGameControllerCTF::Tick() int Num = GameServer()->m_World.FindEntities(F->m_Pos, CFlag::ms_PhysSize, (CEntity**)apCloseCCharacters, MAX_CLIENTS, NETOBJTYPE_CHARACTER); for(int i = 0; i < Num; i++) { - if(!apCloseCCharacters[i]->IsAlive() || apCloseCCharacters[i]->GetPlayer()->GetTeam() == -1 || GameServer()->Collision()->IntersectLine(F->m_Pos, apCloseCCharacters[i]->m_Pos, NULL, NULL)) + if(!apCloseCCharacters[i]->IsAlive() || apCloseCCharacters[i]->GetPlayer()->GetTeam() == TEAM_SPECTATORS || GameServer()->Collision()->IntersectLine(F->m_Pos, apCloseCCharacters[i]->m_Pos, NULL, NULL)) continue; if(apCloseCCharacters[i]->GetPlayer()->GetTeam() == F->m_Team) -- cgit 1.4.1