From 418429741c943f87374f4b1f8a5b7c7ffa1365c1 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 21 Mar 2010 10:48:53 +0000 Subject: [PATCH] Display speed as an absolute value --- src/Game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Game.cpp b/src/Game.cpp index b4075f8..c9da801 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -168,7 +168,7 @@ void Game::update(IPickBufferPtr aPickBuffer, int aDelta) const double msToMPH = 2.237; layout->cast("/speed_label").format( - "Speed: %.1lfmph", train->speed() * msToMPH); + "Speed: %.1lfmph", abs(train->speed()) * msToMPH); layout->get("/brake_label").visible(train->controller()->brakeOn()); -- 2.39.2