diff --git a/scripts/zm/replaced/_zm.gsc b/scripts/zm/replaced/_zm.gsc index e5f8f413..5c768b32 100644 --- a/scripts/zm/replaced/_zm.gsc +++ b/scripts/zm/replaced/_zm.gsc @@ -123,10 +123,11 @@ getfreespawnpoint( spawnpoints, player ) return undefined; } + spawnpoints = array_randomize( spawnpoints ); + if ( !isDefined( game[ "spawns_randomized" ] ) ) { game[ "spawns_randomized" ] = 1; - spawnpoints = array_randomize( spawnpoints ); random_chance = randomint( 100 ); if ( random_chance > 50 ) { @@ -230,14 +231,17 @@ getfreespawnpoint( spawnpoints, player ) for ( j = 0; j < spawnpoints.size; j++ ) { - if ( !isdefined( spawnpoints[ j ].en_num ) ) + if ( !isdefined( game[ self.team + "_spawnpoints_randomized" ] ) ) { + game[ self.team + "_spawnpoints_randomized" ] = 1; + for ( m = 0; m < spawnpoints.size; m++ ) { spawnpoints[ m ].en_num = m; } } - else if ( spawnpoints[ j ].en_num == self.playernum ) + + if ( spawnpoints[ j ].en_num == self.playernum ) { return spawnpoints[ j ]; } diff --git a/scripts/zm/replaced/_zm_game_module.gsc b/scripts/zm/replaced/_zm_game_module.gsc index ecf3efe3..3c3ee14a 100644 --- a/scripts/zm/replaced/_zm_game_module.gsc +++ b/scripts/zm/replaced/_zm_game_module.gsc @@ -231,6 +231,8 @@ zombie_goto_round(target_round) } } + game["axis_spawnpoints_randomized"] = undefined; + game["allies_spawnpoints_randomized"] = undefined; set_game_var("switchedsides", !get_game_var("switchedsides")); maps/mp/zombies/_zm_game_module::respawn_players();