diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut index fef4c8b6c..c7175e749 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_inf.gnut @@ -45,6 +45,15 @@ void function SelectFirstInfectedDelayed() wait 10.0 + RandomFloat( 5.0 ) array players = GetPlayerArray() + + // End game if server empty on selecting infected + if ( !players.len() ) + { + printt( "Couldn't select first infected: player array was empty" ) + SetWinner( INFECTION_TEAM_SURVIVOR ) + return + } + entity infected = players[ RandomInt( players.len() ) ] InfectPlayer( infected )