diff --git a/MapRestartWorkaround/main.gsc b/MapRestartWorkaround/main.gsc index 38a61ed..08b57e8 100644 --- a/MapRestartWorkaround/main.gsc +++ b/MapRestartWorkaround/main.gsc @@ -1,22 +1,30 @@ #include maps\mp\_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() { - initialMapRestart(); //this only happens once to fix invisible player bug - thread gscRestart(); - thread killAllPlayers(); + thread gscRestart(); + thread killAllPlayers(); + for(;;) + { + level waittill("connected", player); + if ( level.scr_zm_ui_gametype_group == "zencounter" || level.scr_zm_ui_gametype_group == "zsurvival" ) + { + 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(); + } + } } -initialMapRestart() -{ - if ( getDvarIntDefault( "initial_restart", "1" ) ) - { - wait 15; - setDvar( "initial_restart", "0" ); //dvars persist between map_restarts - map_restart( false ); - } -} gscRestart() { diff --git a/MapRestartWorkaround/readme.md b/MapRestartWorkaround/readme.md index 5ee9b2c..d9d9028 100644 --- a/MapRestartWorkaround/readme.md +++ b/MapRestartWorkaround/readme.md @@ -66,3 +66,5 @@ Not exactly ideal, but it does mean all players can remain in the lobby and all -Players keep all points -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