Tire bursts and rpm synchronization added (Currently only for DEBUG!)

This commit is contained in:
EntenKoeniq
2021-11-19 06:37:21 +01:00
parent cc6db509f8
commit 13cd3527e0
2 changed files with 28 additions and 1 deletions

View File

@ -281,12 +281,20 @@ namespace CoopClient
int secondaryColor;
int primaryColor;
unsafe
{
Function.Call<int>(Hash.GET_VEHICLE_COLOURS, veh, &primaryColor, &secondaryColor);
}
byte tyreFlag = 0;
for (int i = 0; i < veh.Wheels.Count - 1; i++)
{
if (Function.Call<bool>(Hash.IS_VEHICLE_TYRE_BURST, veh, i, false))
{
tyreFlag |= (byte)(1 << i);
}
}
DebugSyncPed.VehicleModelHash = veh.Model.Hash;
DebugSyncPed.VehicleSeatIndex = (int)player.SeatIndex;
DebugSyncPed.VehiclePosition = veh.Position;
@ -298,6 +306,7 @@ namespace CoopClient
DebugSyncPed.VehicleColors = new int[] { primaryColor, secondaryColor };
DebugSyncPed.VehicleMods = Util.GetVehicleMods(veh);
DebugSyncPed.VehDoors = Util.GetVehicleDoors(veh.Doors);
DebugSyncPed.VehTires = tyreFlag;
DebugSyncPed.LastSyncWasFull = (flags.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0;
DebugSyncPed.IsInVehicle = (flags.Value & (byte)VehicleDataFlags.IsInVehicle) > 0;
DebugSyncPed.VehIsEngineRunning = (flags.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0;