This commit is contained in:
max
2026-03-26 00:43:35 +01:00
parent 932734e5b4
commit e156122357
5 changed files with 13 additions and 52 deletions

View File

@@ -110,12 +110,11 @@ namespace Car_simulation.Core.Components
public string GetCurrentGearName()
{
return _currentGear switch
{
-1 => "R",
0 => "N",
_ => _currentGear.ToString()
};
if (_currentGear == -1) return "R";
if (_currentGear == 0) return "N";
if (_currentGear > 0 && _currentGear <= GearRatios.Length) return _currentGear.ToString();
return "??"; // Debugging: if you see this, _currentGear is out of bounds
}
public float GetClutchSlipPercent() => ClutchSlipRatio * 100f;