1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-10 07:08:06 -05:00

Grief: fix player position and angle on round start freeze

Optimize round start freeze code
This commit is contained in:
Jbleezy
2022-01-03 17:41:15 -08:00
parent b1a6ae9abe
commit 1d71e4b6b5
2 changed files with 10 additions and 12 deletions

View File

@ -237,6 +237,8 @@ zombie_goto_round(target_round)
maps/mp/zombies/_zm_game_module::respawn_players();
wait 0.05; // let all players fully respawn
level thread player_respawn_award();
level thread scripts/zm/zgrief/zgrief_reimagined::round_start_wait(5);
@ -244,8 +246,6 @@ zombie_goto_round(target_round)
player_respawn_award()
{
wait 0.05; // let all players fully respawn
maps/mp/zombies/_zm::award_grenades_for_survivors();
players = get_players();
foreach(player in players)

View File

@ -617,7 +617,14 @@ round_start_wait(time, initial)
players = get_players();
foreach(player in players)
{
player thread wait_and_freeze_controls(1); // need a wait or players can move
// fixes players being frozen at wrong position and angle after respawn
if(!initial)
{
player setOrigin(player.spectator_respawn.origin);
player setPlayerAngles(player.spectator_respawn.angles);
}
player freezeControls(1);
player enableInvulnerability();
player disableWeapons();
}
@ -640,15 +647,6 @@ round_start_wait(time, initial)
level notify("restart_round_start");
}
wait_and_freeze_controls(bool)
{
self endon("disconnect");
wait_network_frame();
self freezeControls(bool);
}
round_start_countdown_hud(time)
{
countdown = createServerFontString( "objective", 2.2 );