about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-29 15:21:16 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-29 15:21:16 +0000
commit3db76357eb515b24dd5817b63f990a0ef6780b79 (patch)
tree549ff5b428ed1820f7fe9fc81c71c330214ae1f6 /src/game
parent108c49b0330c81bbf1251a5d77ba904bdd4ec74f (diff)
downloadzcatch-3db76357eb515b24dd5817b63f990a0ef6780b79.tar.gz
zcatch-3db76357eb515b24dd5817b63f990a0ef6780b79.zip
fixed so that the server won't crash if there are flags missing in ctf
Diffstat (limited to 'src/game')
-rw-r--r--src/game/server/gs_game_ctf.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game/server/gs_game_ctf.cpp b/src/game/server/gs_game_ctf.cpp
index a703e6b6..5c9545fb 100644
--- a/src/game/server/gs_game_ctf.cpp
+++ b/src/game/server/gs_game_ctf.cpp
@@ -6,6 +6,8 @@
 
 gameobject_ctf::gameobject_ctf()
 {
+	flags[0] = 0;
+	flags[1] = 0;
 	is_teamplay = true;
 }
 
@@ -65,7 +67,6 @@ void gameobject_ctf::tick()
 
 	do_team_score_wincheck();
 	
-	// do flags
 	for(int fi = 0; fi < 2; fi++)
 	{
 		flag *f = flags[fi];
@@ -79,7 +80,7 @@ void gameobject_ctf::tick()
 			// update flag position
 			f->pos = f->carrying_player->pos;
 			
-			if(flags[fi^1]->at_stand)
+			if(flags[fi^1] && flags[fi^1]->at_stand)
 			{
 				if(distance(f->pos, flags[fi^1]->pos) < 32)
 				{