Fix player position not correctly set

This commit is contained in:
Sardelka
2022-07-02 12:39:50 +08:00
parent 8ee188cf19
commit 0b2ec1d626
4 changed files with 26 additions and 7 deletions

View File

@ -146,7 +146,7 @@ namespace RageCoop.Server
public ServerObject[] GetAllObjects()
{
return ServerObjects.Values.ToArray();
}
}
/// <summary>
/// Not thread safe
@ -224,5 +224,17 @@ namespace RageCoop.Server
// Server.Logger?.Trace($"Removing ped:{id}");
if (Peds.ContainsKey(id)) { Peds.Remove(id); }
}
internal void Add(ServerPed ped)
{
if (Peds.ContainsKey(ped.ID))
{
Peds[ped.ID]=ped;
}
else
{
Peds.Add(ped.ID, ped);
}
}
}
}