Vehicle duplication prevention

This commit is contained in:
Sardelka9515 2022-08-19 22:31:13 +08:00
parent 1aa23901d5
commit 52cc9b647c

View File

@ -448,7 +448,7 @@ namespace RageCoop.Client
{
if (!VehiclesByHandle.ContainsKey(veh.Handle))
{
if (allVehicles.Length>Main.Settings.WorldVehicleSoftLimit)
if (allVehicles.Length>Main.Settings.WorldVehicleSoftLimit || World.GetNearbyVehicles(veh.Position,2).Length>0)
{
var type = veh.PopulationType;
if (type==EntityPopulationType.RandomAmbient || type==EntityPopulationType.RandomParked)