Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 388635c4 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added check for upshift if max gear is already reached

parent d1070ee5
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Log.Debug("engine speed would fall below idle speed - shift down");
return true;
}
if (inAngularVelocity.IsGreater(DataBus.EngineRatedSpeed)) {
if (inAngularVelocity.IsGreater(DataBus.EngineRatedSpeed) && Data.Gears.ContainsKey(gear + 1)) {
NextGear.SetState(absTime, false, gear + 1, Data.Gears[gear + 1].HasLockedGear);
Log.Debug("engine speed would be above rated speed - shift up");
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment