1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-11 23:57:59 -05:00

Grief: random respawn points

This commit is contained in:
Jbleezy
2022-01-02 02:08:26 -08:00
parent 0952305f8b
commit 52ab420569
2 changed files with 9 additions and 3 deletions

View File

@ -123,10 +123,11 @@ getfreespawnpoint( spawnpoints, player )
return undefined; return undefined;
} }
spawnpoints = array_randomize( spawnpoints );
if ( !isDefined( game[ "spawns_randomized" ] ) ) if ( !isDefined( game[ "spawns_randomized" ] ) )
{ {
game[ "spawns_randomized" ] = 1; game[ "spawns_randomized" ] = 1;
spawnpoints = array_randomize( spawnpoints );
random_chance = randomint( 100 ); random_chance = randomint( 100 );
if ( random_chance > 50 ) if ( random_chance > 50 )
{ {
@ -230,14 +231,17 @@ getfreespawnpoint( spawnpoints, player )
for ( j = 0; j < spawnpoints.size; j++ ) 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++ ) for ( m = 0; m < spawnpoints.size; m++ )
{ {
spawnpoints[ m ].en_num = m; spawnpoints[ m ].en_num = m;
} }
} }
else if ( spawnpoints[ j ].en_num == self.playernum )
if ( spawnpoints[ j ].en_num == self.playernum )
{ {
return spawnpoints[ j ]; return spawnpoints[ j ];
} }

View File

@ -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")); set_game_var("switchedsides", !get_game_var("switchedsides"));
maps/mp/zombies/_zm_game_module::respawn_players(); maps/mp/zombies/_zm_game_module::respawn_players();