Skip to content

Commit 5ad960a

Browse files
committed
Bug fix for https://bugs.launchpad.net/or/+bug/1943837 3D cabs: digitals aren't clamped against Max and MinValue
1 parent acd8383 commit 5ad960a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,6 +2618,7 @@ public string GetDigits(out Color DrawColor)
26182618
var digital = Control as CVCDigital;
26192619
string displayedText = "";
26202620
Num = Locomotive.GetDataOf(Control);
2621+
if (digital.MinValue < digital.MaxValue) Num = MathHelper.Clamp(Num, (float)digital.MinValue, (float)digital.MaxValue);
26212622
if (Math.Abs(Num) < digital.AccuracySwitch)
26222623
Format = Format2;
26232624
else

0 commit comments

Comments
 (0)