1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-25 06:30:22 -05:00

Grief: always use initial spawn point

This commit is contained in:
Jbleezy
2021-12-27 05:42:22 -08:00
parent a5b2d1fa42
commit f082d868c3
2 changed files with 28 additions and 27 deletions

View File

@ -307,6 +307,7 @@
* Added text when rounds are won/lost * Added text when rounds are won/lost
* Added new audio when enemy players bleed out * Added new audio when enemy players bleed out
* Round reset properly restores dual wield weapon left clip ammo, alternative weapon ammo, and equipment * Round reset properly restores dual wield weapon left clip ammo, alternative weapon ammo, and equipment
* Players always respawn at initial spawn points
* Fixed an issue where players initially spawned in the incorrect positions * Fixed an issue where players initially spawned in the incorrect positions
* Random map rotation * Random map rotation
* 20000 health Brutus * 20000 health Brutus

View File

@ -28,45 +28,41 @@ onspawnplayer( predictedspawn )
{ {
self scripts/zm/main/_zm_reimagined_zgrief::set_team(); self scripts/zm/main/_zm_reimagined_zgrief::set_team();
if ( flag( "start_zombie_round_logic" ) ) location = level.scr_zm_map_start_location;
if ( ( location == "default" || location == "" ) && isDefined( level.default_start_location ) )
{ {
spawnpoint = maps/mp/zombies/_zm::check_for_valid_spawn_near_team( self, 1 ); location = level.default_start_location;
} }
if ( !isDefined( spawnpoint ) )
match_string = level.scr_zm_ui_gametype + "_" + location;
spawnpoints = [];
structs = getstructarray( "initial_spawn", "script_noteworthy" );
if ( isdefined( structs ) )
{ {
match_string = ""; for ( i = 0; i < structs.size; i++ )
location = level.scr_zm_map_start_location;
if ( ( location == "default" || location == "" ) && isDefined( level.default_start_location ) )
{ {
location = level.default_start_location; if ( isdefined( structs[ i ].script_string ) )
}
match_string = level.scr_zm_ui_gametype + "_" + location;
spawnpoints = [];
structs = getstructarray( "initial_spawn", "script_noteworthy" );
if ( isdefined( structs ) )
{
for ( i = 0; i < structs.size; i++ )
{ {
if ( isdefined( structs[ i ].script_string ) ) tokens = strtok( structs[ i ].script_string, " " );
foreach ( token in tokens )
{ {
tokens = strtok( structs[ i ].script_string, " " ); if ( token == match_string )
foreach ( token in tokens )
{ {
if ( token == match_string ) spawnpoints[ spawnpoints.size ] = structs[ i ];
{
spawnpoints[ spawnpoints.size ] = structs[ i ];
}
} }
} }
} }
} }
if ( !isDefined( spawnpoints ) || spawnpoints.size == 0 )
{
spawnpoints = getstructarray( "initial_spawn_points", "targetname" );
}
spawnpoint = maps/mp/zombies/_zm::getfreespawnpoint( spawnpoints, self );
} }
if ( !isDefined( spawnpoints ) || spawnpoints.size == 0 )
{
spawnpoints = getstructarray( "initial_spawn_points", "targetname" );
}
spawnpoint = maps/mp/zombies/_zm::getfreespawnpoint( spawnpoints, self );
if ( predictedspawn ) if ( predictedspawn )
{ {
self predictspawnpoint( spawnpoint.origin, spawnpoint.angles ); self predictspawnpoint( spawnpoint.origin, spawnpoint.angles );
@ -77,6 +73,7 @@ onspawnplayer( predictedspawn )
self spawn( spawnpoint.origin, spawnpoint.angles, "zsurvival" ); self spawn( spawnpoint.origin, spawnpoint.angles, "zsurvival" );
} }
} }
self.entity_num = self getentitynumber(); self.entity_num = self getentitynumber();
self thread maps/mp/zombies/_zm::onplayerspawned(); self thread maps/mp/zombies/_zm::onplayerspawned();
self thread maps/mp/zombies/_zm::player_revive_monitor(); self thread maps/mp/zombies/_zm::player_revive_monitor();
@ -91,11 +88,13 @@ onspawnplayer( predictedspawn )
self.zombification_time = 0; self.zombification_time = 0;
self.enabletext = 1; self.enabletext = 1;
self thread maps/mp/zombies/_zm_blockers::rebuild_barrier_reward_reset(); self thread maps/mp/zombies/_zm_blockers::rebuild_barrier_reward_reset();
if ( !is_true( level.host_ended_game ) ) if ( !is_true( level.host_ended_game ) )
{ {
self freeze_player_controls( 0 ); self freeze_player_controls( 0 );
self enableweapons(); self enableweapons();
} }
if ( isDefined( level.game_mode_spawn_player_logic ) ) if ( isDefined( level.game_mode_spawn_player_logic ) )
{ {
spawn_in_spectate = [[ level.game_mode_spawn_player_logic ]](); spawn_in_spectate = [[ level.game_mode_spawn_player_logic ]]();
@ -104,5 +103,6 @@ onspawnplayer( predictedspawn )
self delay_thread( 0.05, maps/mp/zombies/_zm::spawnspectator ); self delay_thread( 0.05, maps/mp/zombies/_zm::spawnspectator );
} }
} }
pixendevent(); pixendevent();
} }