From e38526b627dbba9db6248653445d013b1e6170ca Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Mon, 30 Jul 2018 09:55:53 +0200
Subject: [PATCH] bugfix in amt shift strategy: use min of n95h and gbx speed
 limit

---
 .../Models/SimulationComponent/Impl/AMTShiftStrategy.cs       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs
index 137d9a7e91..b5a3413f29 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/AMTShiftStrategy.cs
@@ -72,8 +72,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 		private bool SpeedTooHighForEngine(uint gear, PerSecond outAngularSpeed)
 		{
 			return
-				(outAngularSpeed * ModelData.Gears[gear].Ratio).IsGreaterOrEqual(ModelData.Gears[gear].MaxSpeed ??
-																				DataBus.EngineN95hSpeed);
+				(outAngularSpeed * ModelData.Gears[gear].Ratio).IsGreaterOrEqual(VectoMath.Min(ModelData.Gears[gear].MaxSpeed,
+																				DataBus.EngineN95hSpeed));
 		}
 
 		public override GearInfo NextGear
-- 
GitLab