Fix player dying when switching characters

This commit is contained in:
oldnapalm
2023-08-09 23:50:47 -03:00
parent 9287aba0f9
commit 2cb5baf5f7

View File

@ -363,7 +363,7 @@ namespace RageCoop.Client
foreach (Ped p in allPeds)
{
SyncedPed c = GetPedByHandle(p.Handle);
if (c == null && (p != Game.Player.Character))
if (c == null && (p != Game.Player.Character) && !Function.Call<bool>(Hash.IS_PLAYER_SWITCH_IN_PROGRESS))
{
if (allPeds.Length > Main.Settings.WorldPedSoftLimit && p.PopulationType == EntityPopulationType.RandomAmbient && !p.IsInVehicle())
{