Avoid vehicle door break and repair loop
This commit is contained in:
@ -307,7 +307,8 @@ namespace RageCoop.Client
|
||||
if (c == null)
|
||||
{
|
||||
if (EntityPool.PedsByID.Count(x => x.Value.OwnerID == packet.OwnerID) < Main.Settings.WorldPedSoftLimit / PlayerList.Players.Count ||
|
||||
EntityPool.VehiclesByID.Any(x => x.Value.Position.DistanceTo(packet.Position) < 2) || packet.ID == packet.OwnerID)
|
||||
/*EntityPool.VehiclesByID.Any(x => x.Value.Position.DistanceTo(packet.Position) < 2) ||*/ // allows players to exceed the peds limit
|
||||
packet.ID == packet.OwnerID)
|
||||
{
|
||||
// Main.Logger.Debug($"Creating character for incoming sync:{packet.ID}");
|
||||
EntityPool.ThreadSafe.Add(c = new SyncedPed(packet.ID));
|
||||
|
@ -174,12 +174,12 @@ namespace RageCoop.Client
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (door.IsBroken)
|
||||
/*else if (door.IsBroken) // causes break/repair loop in some situations
|
||||
{
|
||||
// The vehicle can only fix a door if the vehicle was completely fixed
|
||||
veh.Repair();
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
if ((model.OpenedDoors & (byte)(1 << i)) != 0)
|
||||
{
|
||||
if ((!door.IsOpen) && (!door.IsBroken))
|
||||
@ -196,10 +196,10 @@ namespace RageCoop.Client
|
||||
{
|
||||
veh.Windows[(VehicleWindowIndex)i].Smash();
|
||||
}
|
||||
else if (!veh.Windows[(VehicleWindowIndex)i].IsIntact)
|
||||
/*else if (!veh.Windows[(VehicleWindowIndex)i].IsIntact) // causes smash/repair loop in some situations
|
||||
{
|
||||
veh.Windows[(VehicleWindowIndex)i].Repair();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
foreach (VehicleWheel wheel in veh.Wheels)
|
||||
|
Reference in New Issue
Block a user