mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38:26 +00:00
fix tf2 respawn loop crash thing?
This commit is contained in:
parent
fdacc94c32
commit
f93f6cac3a
@ -3117,40 +3117,25 @@ public void Shavit_OnRestart(int client, int track)
|
||||
return;
|
||||
}
|
||||
|
||||
if(!IsPlayerAlive(client))
|
||||
if(gCV_RespawnOnRestart.BoolValue && !IsPlayerAlive(client))
|
||||
{
|
||||
if(gEV_Type == Engine_TF2)
|
||||
{
|
||||
TF2_ChangeClientTeam(client, view_as<TFTeam>(3));
|
||||
TF2_ChangeClientTeam(client, view_as<TFTeam>(GetRandomInt(2, 3)));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(FindEntityByClassname(-1, "info_player_terrorist") != -1)
|
||||
{
|
||||
CS_SwitchTeam(client, 2);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
CS_SwitchTeam(client, 3);
|
||||
}
|
||||
CS_SwitchTeam(client, GetRandomInt(2, 3));
|
||||
}
|
||||
|
||||
if(gEV_Type == Engine_TF2)
|
||||
{
|
||||
TF2_RespawnPlayer(client);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
CS_RespawnPlayer(client);
|
||||
}
|
||||
|
||||
if(gCV_RespawnOnRestart.BoolValue)
|
||||
{
|
||||
RestartTimer(client, track);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user