OpenBVE icon indicating copy to clipboard operation
OpenBVE copied to clipboard

Possible solution for the overspeed warning text message issue

Open BPI-919 opened this issue 6 months ago • 9 comments

Hi,

I faced in the main game, with Normal game mode, that if the current track speed limit is set to e.g. 50 km/h, with Track.Limit 50 command in the .csv Route file, and I exceed this while I adjust the speed of the playerTrain, I got the warning text message, and this part is okay.

However, when I reduce my speed under 50.00 km/h, e.g. to 49.85 km/h, this warning message is still visible, it only disappears when I reduce the current speed of the train to 49.49 km/h, and this is not okay.

I was thinking about this and I already turned out at the beginning that this is a rounding issue, and finally I think I successfully found the source of the issue, see it below:

The corrected line:

spd = Math.Round(spd * 3.6, 2);

The actual line:

https://github.com/leezer3/OpenBVE/blob/46aa20b03e6681cf1146c07e615a61cf41f2fd40/source/OpenBVE/Game/MessageManager.TextualMessages.cs#L49

Unfortunately, I can write on my phone only in these days, therefore could You please fix this issue with this modification?

Thanks for the help in advance.

BPI-919 avatar Aug 12 '25 21:08 BPI-919