The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: jamespetts on December 28, 2012, 12:27:24 PM

Title: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: jamespetts on December 28, 2012, 12:27:24 PM
Running Simutrans-Experimental 10.18 on my Linux machine at home, I notice that more expensive items in the depot show a very large negative number instead of their true cost, although, on purchasing them, the correct amount is deducted from the player's account. This looks to be a GUI issue, which I shall have to investigate when I get time.

Edit: I wonder whether this (https://github.com/jamespetts/simutrans-experimental/commit/22f7e013875d4b77f81d0b2489d5a8b0cbeeac27) commit made a difference...? Incidentally, does anyone else run Simutrans-Experimental on Linux so that, when I get back home to my Windows computer and can fix it, people can test whether my fix has worked?
Title: Re: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: wlindley on December 28, 2012, 03:33:56 PM
James -- I run Experimental on linux 64-bit (Fedora) and had noticed that too... Will be glad to test.
Title: Re: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: jamespetts on December 28, 2012, 03:35:22 PM
Thank you, that is very kind. Are you able to compile from source?
Title: Re: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: dannyman on January 09, 2013, 04:51:56 AM
I have just compiled on Linux.  Looking forward to trying out the latest. :)
Title: Re: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: jamespetts on January 12, 2013, 05:17:05 PM
W. Lindley - can I check first of all to see whether this problem is just in the translation texts? I am back home now, and cannot test on a Linux machine. Can you check that you have the latest version of en.tab, and that it contains the following line:


LOCO_INFO_EXT
%s\nCost: %s\nMaint.: %1.2f$/km, %1.2f$/month\nPower: %dkW, %dkN\nTop Speed: %dkm/h\nWeight: %dt\nMax. brake force: %dkN\nRolling resistance: %fN\n


and see whether the problem still occurs? The cost should be a string value, so if the translation interprets it as a number, this will be wrong.
Title: Re: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: wlindley on January 12, 2013, 05:38:44 PM
Aha!  Changing %d to %s corrected the problem: Costs are now reported correctly!
Title: Re: [10.18] Large numbers in the depot/replace window appear negative in Linux
Post by: jamespetts on January 12, 2013, 05:42:33 PM
Excellent! I shall consider this issue closed. Thank you for testing.