From 67c4d9a6947771ed144c1d9f31f51b6de7bdb511 Mon Sep 17 00:00:00 2001 From: EntenKoeniq <81123713+EntenKoeniq@users.noreply.github.com> Date: Sun, 10 Apr 2022 15:01:16 +0200 Subject: [PATCH] Don't check if the tire is punctured if it has burst --- Client/Util.cs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Client/Util.cs b/Client/Util.cs index 284b985..dd4b853 100644 --- a/Client/Util.cs +++ b/Client/Util.cs @@ -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(); - } } }