about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-12-19 08:26:58 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-12-19 08:26:58 +0000
commit55254d065772278b8503746c1d34fc722a7fa5b4 (patch)
tree456ab09dde97baca7eacba5c426b98f489b54362 /src/game
parent557636dca31ed4953370c69212b7b7b64ab81773 (diff)
downloadzcatch-55254d065772278b8503746c1d34fc722a7fa5b4.tar.gz
zcatch-55254d065772278b8503746c1d34fc722a7fa5b4.zip
fixed crashbug caused by players disconnecting while still having bullets in the air
Diffstat (limited to 'src/game')
-rw-r--r--src/game/server/gamecontroller.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp
index 3391ece1..4fedeefc 100644
--- a/src/game/server/gamecontroller.cpp
+++ b/src/game/server/gamecontroller.cpp
@@ -345,6 +345,9 @@ bool GAMECONTROLLER::is_friendly_fire(int cid1, int cid2)
 	
 	if(is_teamplay())
 	{
+		if(!game.players[cid1] || !game.players[cid2])
+			return false;
+			
 		if(game.players[cid1]->team == game.players[cid2]->team)
 			return true;
 	}
@@ -505,6 +508,10 @@ void GAMECONTROLLER::snap(int snapping_client)
 
 int GAMECONTROLLER::get_auto_team(int notthisid)
 {
+	// this will force the auto balancer to work overtime aswell
+	if(config.dbg_stress)
+		return 0;
+	
 	int numplayers[2] = {0,0};
 	for(int i = 0; i < MAX_CLIENTS; i++)
 	{