diff options
author | DBmaoha <56738369+DBmaoha@users.noreply.github.com> | 2022-10-22 02:44:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 19:44:20 +0100 |
commit | 1dc1986a7ab58a212be42ce557f5407029723f01 (patch) | |
tree | 51faa596777081db8b17a82e45e23903497176db | |
parent | 74093a1afcf85ac6c66329d47b30f0d9cdadb50b (diff) | |
download | NorthstarMods-1dc1986a7ab58a212be42ce557f5407029723f01.tar.gz NorthstarMods-1dc1986a7ab58a212be42ce557f5407029723f01.zip |
Fixed SuddenDeath Based Modes Stuck (#496)
* Fixed SuddenDeath Based Modes Stuck
Added checks so sudden death based gamemodes won't stuck if there ain't any players in server
* Make scripts able to run
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut | 14 |
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 ) } |