diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 56373b42..fb46b8b9 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -30,6 +30,7 @@ main() replaceFunc(maps/mp/zombies/_zm::ai_calculate_health, scripts/zm/replaced/_zm::ai_calculate_health); replaceFunc(maps/mp/zombies/_zm::last_stand_pistol_rank_init, scripts/zm/replaced/_zm::last_stand_pistol_rank_init); replaceFunc(maps/mp/zombies/_zm::actor_damage_override, scripts/zm/replaced/_zm::actor_damage_override); + replaceFunc(maps/mp/zombies/_zm::player_spawn_protection, scripts/zm/replaced/_zm::player_spawn_protection); replaceFunc(maps/mp/zombies/_zm::wait_and_revive, scripts/zm/replaced/_zm::wait_and_revive); replaceFunc(maps/mp/zombies/_zm::player_revive_monitor, scripts/zm/replaced/_zm::player_revive_monitor); replaceFunc(maps/mp/zombies/_zm::end_game, scripts/zm/replaced/_zm::end_game); @@ -1899,20 +1900,32 @@ veryhurt_blood_fx() ignoreme_after_revived() { - self endon( "disconnect" ); + self endon("disconnect"); while(1) { - self waittill( "player_revived", reviver ); + self waittill("player_revived", reviver); - self.ignoreme = 1; - - wait 1; - - self.ignoreme = 0; + self thread player_revive_protection(); } } +player_revive_protection() +{ + self endon("disconnect"); + + self.revive_protection = 1; + + for(i = 0; i < 20; i++) + { + self.ignoreme = 1; + wait 0.05; + } + + self.ignoreme = 0; + self.revive_protection = 0; +} + fall_velocity_check() { self endon("disconnect"); diff --git a/scripts/zm/replaced/_zm.gsc b/scripts/zm/replaced/_zm.gsc index 6a739794..7abce93f 100644 --- a/scripts/zm/replaced/_zm.gsc +++ b/scripts/zm/replaced/_zm.gsc @@ -902,6 +902,22 @@ player_laststand( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, s } } +player_spawn_protection() +{ + self endon( "disconnect" ); + + self.spawn_protection = 1; + + for ( x = 0; x < 60; x++ ) + { + self.ignoreme = 1; + wait 0.05; + } + + self.ignoreme = 0; + self.spawn_protection = 0; +} + wait_and_revive() { flag_set( "wait_and_revive" ); diff --git a/scripts/zm/zgrief/zgrief_reimagined.gsc b/scripts/zm/zgrief/zgrief_reimagined.gsc index 80aec8eb..e256f49d 100644 --- a/scripts/zm/zgrief/zgrief_reimagined.gsc +++ b/scripts/zm/zgrief/zgrief_reimagined.gsc @@ -2199,7 +2199,11 @@ containment_think() { if(is_player_valid(player)) { - player.ignoreme = 0; + if(!is_true(player.spawn_protection) && !is_true(player.revive_protection)) + { + player.ignoreme = 0; + } + in_containment_zone[player.team]++; if(isads(player)) @@ -2307,7 +2311,10 @@ containment_think() { if(is_player_valid(player)) { - player.ignoreme = 0; + if(!is_true(player.spawn_protection) && !is_true(player.revive_protection)) + { + player.ignoreme = 0; + } } player.containment_waypoint.color = (1, 1, 1); } @@ -2327,7 +2334,10 @@ containment_think() { if(is_player_valid(player)) { - player.ignoreme = 0; + if(!is_true(player.spawn_protection) && !is_true(player.revive_protection)) + { + player.ignoreme = 0; + } } if(isDefined(player.containment_waypoint))