about summary refs log tree commit diff
diff options
context:
space:
mode:
authorscosu <scosu@gmx.de>2008-11-04 07:20:24 +0000
committerscosu <scosu@gmx.de>2008-11-04 07:20:24 +0000
commite1807ea08a7a97236697197d6fc25ead882ad6c7 (patch)
treecb27f8f754434ce5dedcaa85aff8e2b512de5568
parent12127c0acdcdf7182729c8e1231feb48910d5404 (diff)
downloadzcatch-e1807ea08a7a97236697197d6fc25ead882ad6c7.tar.gz
zcatch-e1807ea08a7a97236697197d6fc25ead882ad6c7.zip
fix for ticket #549 by using col_intersect_line
-rw-r--r--src/game/server/gamemodes/ctf.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/server/gamemodes/ctf.cpp b/src/game/server/gamemodes/ctf.cpp
index 0ef82df8..90c77515 100644
--- a/src/game/server/gamemodes/ctf.cpp
+++ b/src/game/server/gamemodes/ctf.cpp
@@ -115,7 +115,8 @@ void GAMECONTROLLER_CTF::tick()
 			int num = game.world.find_entities(f->pos, 32.0f, (ENTITY**)close_characters, MAX_CLIENTS, NETOBJTYPE_CHARACTER);
 			for(int i = 0; i < num; i++)
 			{
-				if(close_characters[i]->team == f->team)
+				int collision = col_intersect_line(f->pos, close_characters[i]->pos, NULL);
+				if(!collision && close_characters[i]->team == f->team)
 				{
 					// return the flag
 					if(!f->at_stand)
@@ -131,7 +132,7 @@ void GAMECONTROLLER_CTF::tick()
 						f->reset();
 					}
 				}
-				else
+				else if(!collision)
 				{
 					// take the flag
 					if(f->at_stand)