Some changes and bug fixes

This commit is contained in:
EntenKoeniq
2022-04-14 05:27:47 +02:00
parent 81733a2c19
commit e978c13f41
11 changed files with 86 additions and 138 deletions

View File

@ -379,20 +379,13 @@ namespace CoopClient
}
}
// Bursted and Punctured tires
short puncturedTires = 0;
// Bursted tires
short burstedTires = 0;
foreach (VehicleWheel wheel in veh.Wheels.GetAllWheels())
{
if (wheel.IsBursted)
{
burstedTires |= (short)(1 << (int)wheel.BoneId);
continue;
}
if (wheel.IsPunctured)
{
puncturedTires |= (short)(1 << (int)wheel.BoneId);
}
}
@ -401,7 +394,6 @@ namespace CoopClient
BrokenDoors = brokenDoors,
BrokenWindows = brokenWindows,
BurstedTires = burstedTires,
PuncturedTires = puncturedTires,
LeftHeadLightBroken = (byte)(veh.IsLeftHeadLightBroken ? 1 : 0),
RightHeadLightBroken = (byte)(veh.IsRightHeadLightBroken ? 1 : 0)
};
@ -441,25 +433,11 @@ namespace CoopClient
wheel.Puncture();
wheel.Burst();
}
continue;
}
else if (wheel.IsBursted)
{
wheel.Fix();
}
if ((model.PuncturedTires & (short)(1 << (int)wheel.BoneId)) != 0)
{
if (!wheel.IsPunctured)
{
wheel.Puncture();
}
}
else if (wheel.IsPunctured)
{
wheel.Fix();
}
}
veh.IsLeftHeadLightBroken = model.LeftHeadLightBroken > 0;