Don't check if the tire is punctured if it has burst
This commit is contained in:
@ -364,6 +364,9 @@ namespace CoopClient
|
|||||||
if (wheel.IsBursted)
|
if (wheel.IsBursted)
|
||||||
{
|
{
|
||||||
result.BurstedTires |= (ushort)(1 << (int)wheel.BoneId);
|
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)
|
if (wheel.IsPunctured)
|
||||||
@ -402,6 +405,21 @@ namespace CoopClient
|
|||||||
|
|
||||||
foreach (VehicleWheel wheel in veh.Wheels)
|
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 ((model.PuncturedTires & (ushort)(1 << (int)wheel.BoneId)) != 0)
|
||||||
{
|
{
|
||||||
if (!wheel.IsPunctured)
|
if (!wheel.IsPunctured)
|
||||||
@ -413,18 +431,6 @@ namespace CoopClient
|
|||||||
{
|
{
|
||||||
wheel.Fix();
|
wheel.Fix();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((model.BurstedTires & (ushort)(1 << (int)wheel.BoneId)) != 0)
|
|
||||||
{
|
|
||||||
if (!wheel.IsBursted)
|
|
||||||
{
|
|
||||||
wheel.Burst();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (wheel.IsBursted)
|
|
||||||
{
|
|
||||||
wheel.Fix();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user