mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-06-08 01:47:50 -05:00
deleted test code and changed a for loop to while loop
For some reason for loops with continues will seemingly overflow and go infinite 100% of the time. However, while loops do not so the for loop in manage_zones() was changed to a while loop with no change in functionality.
This commit is contained in:
parent
698dc4ee5f
commit
5f5ce72dfb
@ -6,7 +6,6 @@
|
||||
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
//thread gsc_restart(); //new addition to test map_restart
|
||||
flag_init( "zones_initialized" );
|
||||
level.zones = [];
|
||||
level.zone_flags = [];
|
||||
@ -165,12 +164,11 @@ zone_init( zone_name ) //checked changed to match cerberus output
|
||||
}
|
||||
level.zones[ zone_name ] = spawnstruct();
|
||||
zone = level.zones[ zone_name ];
|
||||
zone.is_enabled = 1; //has to be one otherwise most maps won't accept connections
|
||||
zone.is_occupied = 0; //normally 0
|
||||
zone.is_active = 0; //normally 0
|
||||
zone.is_enabled = 0;
|
||||
zone.is_occupied = 0;
|
||||
zone.is_active = 0;
|
||||
zone.adjacent_zones = [];
|
||||
zone.is_spawning_allowed = 0; //normally 0;
|
||||
|
||||
zone.is_spawning_allowed = 0;
|
||||
spawn_points = maps/mp/gametypes_zm/_zm_gametype::get_player_spawns_for_gametype();
|
||||
for( i = 0; i < spawn_points.size; i++ )
|
||||
{
|
||||
@ -393,13 +391,10 @@ reinit_zone_spawners() //checked changed to match cerberus output
|
||||
|
||||
enable_zone( zone_name ) //checked changed to match cerberus output
|
||||
{
|
||||
//enable the zone even if its already enabled to get around the fact that zone_init() has to enable zones
|
||||
/*
|
||||
if ( level.zones[ zone_name ].is_enabled )
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
level.zones[ zone_name ].is_enabled = 1;
|
||||
level.zones[zone_name].is_spawning_allowed = 1;
|
||||
level notify( zone_name );
|
||||
@ -564,7 +559,6 @@ zone_flag_wait( flag_name )
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
keys = getarraykeys( level.zone_flags );
|
||||
for ( i = 0; i < keys.size; i++ )
|
||||
{
|
||||
@ -598,8 +592,8 @@ connect_zones( zone_name_a, zone_name_b, one_way ) //checked matches cerberus ou
|
||||
}
|
||||
zone_init( zone_name_a );
|
||||
zone_init( zone_name_b );
|
||||
enable_zone( zone_name_a ); //was disabled
|
||||
enable_zone( zone_name_b ); //was disabled
|
||||
enable_zone( zone_name_a );
|
||||
enable_zone( zone_name_b );
|
||||
if ( !isDefined( level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] ) )
|
||||
{
|
||||
level.zones[ zone_name_a ].adjacent_zones[ zone_name_b ] = spawnstruct();
|
||||
@ -669,12 +663,14 @@ manage_zones( initial_zone ) //checked changed to match cerberus output
|
||||
a_zone_is_active = 0;
|
||||
a_zone_is_spawning_allowed = 0;
|
||||
level.zone_scanning_active = 1;
|
||||
for ( z = 0; z < zkeys.size; z++ )
|
||||
z = 0;
|
||||
while ( z < zkeys.size )
|
||||
{
|
||||
zone = level.zones[ zkeys[ z ] ];
|
||||
newzone = level.newzones[ zkeys[ z ] ];
|
||||
if( !zone.is_enabled )
|
||||
{
|
||||
z++;
|
||||
continue;
|
||||
}
|
||||
if ( isdefined(level.zone_occupied_func ) )
|
||||
@ -717,6 +713,7 @@ manage_zones( initial_zone ) //checked changed to match cerberus output
|
||||
zone_choke = 0;
|
||||
wait 0.05;
|
||||
}
|
||||
z++;
|
||||
}
|
||||
level.zone_scanning_active = 0;
|
||||
for ( z = 0; z < zkeys.size; z++ )
|
||||
@ -960,7 +957,6 @@ get_active_zone_names() //checked changed to match cerberus output
|
||||
{
|
||||
wait 0.05;
|
||||
}
|
||||
i = 0;
|
||||
for ( i = 0; i < level.zone_keys.size; i++ )
|
||||
{
|
||||
if ( level.zones[ level.zone_keys[ i ] ].is_active )
|
||||
@ -1097,39 +1093,12 @@ _debug_zones() //checked changed to match cerberus output
|
||||
is_player_in_zone( zone_name ) //checked changed to match cerberus output
|
||||
{
|
||||
zone = level.zones[ zone_name ];
|
||||
i = 0;
|
||||
for ( i = 0; i < zone.volumes.size; i++ )
|
||||
{
|
||||
if(self istouching(level.zones[zone_name].volumes[i]) && !self.sessionstate == "spectator")
|
||||
if ( self istouching( level.zones[ zone_name ].volumes[ i ] ) && self.sessionstate != "spectator")
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
is_player_in_zone_zonemgr_usage( zone_name ) //added to fix is_player_in_zone not working for zonemgr purposes
|
||||
{
|
||||
zone = level.zones[ zone_name ];
|
||||
i = 0;
|
||||
players = get_players();
|
||||
for ( i = 0; i < zone.volumes.size; i++ )
|
||||
{
|
||||
for ( k = 0; k < players.size; k++ )
|
||||
{
|
||||
if ( players[ k ] istouching( level.zones[ zone_name ].volumes[ i ] ) && !players[ k ].sessionstate == "spectator" )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
gsc_restart()
|
||||
{
|
||||
level waittill( "end_game" );
|
||||
wait 3;
|
||||
map_restart( false );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user