diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 0d028f047e783f515ac1ef6a8a3810f60d1d96ac..7a6030066bec97a50e8d720783e73ef1a2c69555 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -1001,11 +1001,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl third = Driver.DrivingActionCoast(absTime, ds, velocityWithOverspeed, gradient); debug.Add(new { action = "second:Overload -> Coast", third }); - if (third is ResponseGearShift) { - third = Driver.DrivingActionCoast(absTime, ds, velocityWithOverspeed, gradient); - debug.Add(new { action = "third:GearShift -> try again Coast", third }); - } switch (third) { + case ResponseGearShift _: + third = Driver.DrivingActionCoast(absTime, ds, velocityWithOverspeed, gradient); + debug.Add(new { action = "third:GearShift -> try again Coast", third }); + break; case ResponseSpeedLimitExceeded _: if (DataBus.GearboxInfo.GearboxType.AutomaticTransmission() && !DataBus.GearboxInfo.Gear.IsLockedGear()) {