fixed invisible player glitch

This commit is contained in:
JezuzLizard 2020-03-10 02:43:56 -07:00
parent 7a14142e24
commit 59d4f88779
2 changed files with 22 additions and 12 deletions

View File

@ -1,23 +1,31 @@
#include maps\mp\_utility; #include maps\mp\_utility;
#include common_scripts\utility; #include common_scripts\utility;
#include maps\mp\zm_alcatraz_grief_cellblock;
#include maps\mp\zm_prison;
#include maps\mp\zm_highrise;
#include maps\mp\zm_transit;
#include maps\mp\zm_buried;
#include maps\mp\zm_tomb;
init() init()
{ {
initialMapRestart(); //this only happens once to fix invisible player bug
thread gscRestart(); thread gscRestart();
thread killAllPlayers(); thread killAllPlayers();
} for(;;)
initialMapRestart()
{
if ( getDvarIntDefault( "initial_restart", "1" ) )
{ {
wait 15; level waittill("connected", player);
setDvar( "initial_restart", "0" ); //dvars persist between map_restarts if ( level.scr_zm_ui_gametype_group == "zencounter" || level.scr_zm_ui_gametype_group == "zsurvival" )
map_restart( false ); {
player thread give_team_characters(); //the real cause of the invisible player glitch these 2 functions aren't always called on map_restart so call them here
}
else
{
player thread give_personality_characters();
}
} }
} }
gscRestart() gscRestart()
{ {
while ( 1 ) while ( 1 )

View File

@ -66,3 +66,5 @@ Not exactly ideal, but it does mean all players can remain in the lobby and all
-Players keep all points -Players keep all points
-End game check is disabled just incase player[0] leaves during the respawn function its reenabled when players are respawned -End game check is disabled just incase player[0] leaves during the respawn function its reenabled when players are respawned
-Fixed invisible player glitch hopefully for good