From 55254d065772278b8503746c1d34fc722a7fa5b4 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Fri, 19 Dec 2008 08:26:58 +0000 Subject: fixed crashbug caused by players disconnecting while still having bullets in the air --- src/game/server/gamecontroller.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/game/server/gamecontroller.cpp') 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++) { -- cgit 1.4.1