aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut14
1 files changed, 14 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index 6cde4655..a44d7590 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -509,6 +509,20 @@ void function GameStateEnter_SuddenDeath()
{
// disable respawns, suddendeath calling is done on a kill callback
SetRespawnsEnabled( false )
+
+ // defensive fixes, so game won't stuck in SuddenDeath forever
+ bool mltElimited = false
+ bool imcElimited = false
+ if( GetPlayerArrayOfTeam_Alive( TEAM_MILITIA ).len() < 1 )
+ mltElimited = true
+ if( GetPlayerArrayOfTeam_Alive( TEAM_IMC ).len() < 1 )
+ imcElimited = true
+ if( mltElimited && imcElimited )
+ SetWinner( TEAM_UNASSIGNED )
+ else if( mltElimited )
+ SetWinner( TEAM_IMC )
+ else if( imcElimited )
+ SetWinner( TEAM_MILITIA )
}