Bug fix for vehicle color. Interval by FPS

This commit is contained in:
EntenKoeniq
2021-11-27 00:26:12 +01:00
parent 5c7e7f45a0
commit a739497328
4 changed files with 8 additions and 8 deletions

View File

@ -297,6 +297,11 @@ namespace CoopClient
} }
#region -- VEHICLE SYNC -- #region -- VEHICLE SYNC --
if (MainVehicle.GetResponsiblePedHandle() != Character.Handle)
{
return;
}
if (VehicleColors != null && VehicleColors != LastVehicleColors) if (VehicleColors != null && VehicleColors != LastVehicleColors)
{ {
Function.Call(Hash.SET_VEHICLE_COLOURS, MainVehicle, VehicleColors[0], VehicleColors[1]); Function.Call(Hash.SET_VEHICLE_COLOURS, MainVehicle, VehicleColors[0], VehicleColors[1]);
@ -322,11 +327,6 @@ namespace CoopClient
} }
else else
{ {
if (MainVehicle.GetResponsiblePedHandle() != Character.Handle)
{
return;
}
if (VehicleMods != null && VehicleMods != LastVehicleMods) if (VehicleMods != null && VehicleMods != LastVehicleMods)
{ {
Function.Call(Hash.SET_VEHICLE_MOD_KIT, MainVehicle, 0); Function.Call(Hash.SET_VEHICLE_MOD_KIT, MainVehicle, 0);

View File

@ -11,7 +11,7 @@ namespace CoopClient.Entities
public EntitiesThread() public EntitiesThread()
{ {
Tick += OnTick; Tick += OnTick;
Interval = 1000 / 60; Interval = (int)(1f / (Game.FPS > 60f ? 60f : Game.FPS) * 1000f);
} }
private void OnTick(object sender, EventArgs e) private void OnTick(object sender, EventArgs e)

View File

@ -104,7 +104,7 @@ namespace CoopClient
} }
#endif #endif
if ((Util.GetTickCount64() - LastDataSend) < (1000 / 60)) if ((Util.GetTickCount64() - LastDataSend) < ((ulong)(1f / (Game.FPS > 60f ? 60f : Game.FPS) * 1000f)))
{ {
return; return;
} }

View File

@ -13,7 +13,7 @@ namespace CoopClient
public WorldThread() public WorldThread()
{ {
Tick += OnTick; Tick += OnTick;
Interval = 1000 / 60; Interval = (int)(1f / (Game.FPS > 60f ? 60f : Game.FPS) * 1000f);
Aborted += (sender, e) => Aborted += (sender, e) =>
{ {
if (LastDisableTraffic) if (LastDisableTraffic)