Delay vehicle repair, fix vehicle if BodyHealth increased

This commit is contained in:
Sardelka
2022-07-21 23:10:56 +08:00
parent 44a8445b54
commit cb53e8a664
3 changed files with 12 additions and 0 deletions

View File

@ -122,6 +122,11 @@ namespace RageCoop.Client
{
packet.RadioStation=Util.GetPlayerRadioIndex();
}
if (packet.EngineHealth>v.LastEngineHealth)
{
packet.Flags |= VehicleDataFlags.Repaired;
}
v.LastEngineHealth=packet.EngineHealth;
}
Send(packet, ConnectionChannel.VehicleSync);
}

View File

@ -308,6 +308,10 @@ namespace RageCoop.Client
}
}
#endregion
if (Flags.HasVehFlag(VehicleDataFlags.Repaired))
{
MainVehicle.Repair();
}
if (Colors != null && Colors != _lastVehicleColors)
{
Function.Call(Hash.SET_VEHICLE_COLOURS, MainVehicle, Colors[0], Colors[1]);
@ -459,6 +463,8 @@ namespace RageCoop.Client
#region OUTGOING
internal float LastNozzleAngle { get; set; }
internal float LastEngineHealth { get; set; }
#endregion
}

View File

@ -117,6 +117,7 @@ namespace RageCoop.Core
HasRoof=1 << 12,
IsFullSync = 1<<13,
IsOnFire = 1<<14,
Repaired = 1<<15,
}
internal enum PlayerConfigFlags : byte