Don't check if the tire is punctured if it has burst

This commit is contained in:
EntenKoeniq 2022-04-10 15:01:16 +02:00
parent 7a010a6da2
commit 67c4d9a694

View File

@ -364,6 +364,9 @@ namespace CoopClient
if (wheel.IsBursted)
{
result.BurstedTires |= (ushort)(1 << (int)wheel.BoneId);
// Tire is bursted so we don't need to check if the tire punctured
continue;
}
if (wheel.IsPunctured)
@ -402,6 +405,21 @@ namespace CoopClient
foreach (VehicleWheel wheel in veh.Wheels)
{
if ((model.BurstedTires & (ushort)(1 << (int)wheel.BoneId)) != 0)
{
if (!wheel.IsBursted)
{
wheel.Burst();
}
// Tire is bursted so we don't need to check if the tire punctured
continue;
}
else if (wheel.IsBursted)
{
wheel.Fix();
}
if ((model.PuncturedTires & (ushort)(1 << (int)wheel.BoneId)) != 0)
{
if (!wheel.IsPunctured)
@ -413,18 +431,6 @@ namespace CoopClient
{
wheel.Fix();
}
if ((model.BurstedTires & (ushort)(1 << (int)wheel.BoneId)) != 0)
{
if (!wheel.IsBursted)
{
wheel.Burst();
}
}
else if (wheel.IsBursted)
{
wheel.Fix();
}
}
}