about summary refs log tree commit diff
path: root/src/game/server/gamemodes/ctf.cpp
diff options
context:
space:
mode:
authorFujnky <larsfunke1996@gmail.com>2010-06-03 17:47:32 +0200
committerFujnky <larsfunke1996@gmail.com>2010-06-03 17:47:32 +0200
commit5849aeb86c5ae41fc83e6f8e5583b65a117d7114 (patch)
tree0801cb063a54c94fd9f142f328476330849eb7e8 /src/game/server/gamemodes/ctf.cpp
parent5a641132e7d445157434b8af0c73947d2cef987f (diff)
parenta6ab379e67f712524635cac1c8131314933b8f59 (diff)
downloadzcatch-5849aeb86c5ae41fc83e6f8e5583b65a117d7114.tar.gz
zcatch-5849aeb86c5ae41fc83e6f8e5583b65a117d7114.zip
Merge branch 'master' of git://github.com/matricks/teeworlds
Conflicts:
	src/game/server/gamemodes/ctf.cpp
Diffstat (limited to 'src/game/server/gamemodes/ctf.cpp')
-rw-r--r--src/game/server/gamemodes/ctf.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game/server/gamemodes/ctf.cpp b/src/game/server/gamemodes/ctf.cpp
index c1585912..3c052a91 100644
--- a/src/game/server/gamemodes/ctf.cpp
+++ b/src/game/server/gamemodes/ctf.cpp
@@ -105,7 +105,7 @@ void CGameControllerCTF::Tick()
 			
 			if(m_apFlags[fi^1] && m_apFlags[fi^1]->m_AtStand)
 			{
-				if(distance(F->m_Pos, m_apFlags[fi^1]->m_Pos) < 28)
+				if(distance(F->m_Pos, m_apFlags[fi^1]->m_Pos) < CFlag::ms_PhysSize + CCharacter::ms_PhysSize)
 				{
 					// CAPTURE! \o/
 					m_aTeamscore[fi^1] += 100;
@@ -136,7 +136,7 @@ void CGameControllerCTF::Tick()
 		else
 		{
 			CCharacter *apCloseCCharacters[MAX_CLIENTS];
-			int Num = GameServer()->m_World.FindEntities(F->m_Pos, 7.0f, (CEntity**)apCloseCCharacters, MAX_CLIENTS, NETOBJTYPE_CHARACTER);
+			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))
@@ -199,7 +199,7 @@ void CGameControllerCTF::Tick()
 				else
 				{
 					F->m_Vel.y += GameServer()->m_World.m_Core.m_Tuning.m_Gravity;
-					GameServer()->Collision()->MoveBox(&F->m_Pos, &F->m_Vel, vec2(F->m_PhysSize, F->m_PhysSize), 0.5f);
+					GameServer()->Collision()->MoveBox(&F->m_Pos, &F->m_Vel, vec2(F->ms_PhysSize, F->ms_PhysSize), 0.5f);
 				}
 			}
 		}
@@ -211,7 +211,7 @@ CFlag::CFlag(CGameWorld *pGameWorld, int Team)
 : CEntity(pGameWorld, NETOBJTYPE_FLAG)
 {
 	m_Team = Team;
-	m_ProximityRadius = m_PhysSize;
+	m_ProximityRadius = ms_PhysSize;
 	m_pCarryingCharacter = 0x0;
 	m_GrabTick = 0;
 	
@@ -240,3 +240,4 @@ void CFlag::Snap(int SnappingClient)
 	else if(m_pCarryingCharacter && m_pCarryingCharacter->GetPlayer())
 		pFlag->m_CarriedBy = m_pCarryingCharacter->GetPlayer()->GetCID();
 }
+