News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

[Bug v4.5] An Easy Way to Become a Billionnaire ^_^

Started by knightly, July 05, 2009, 08:52:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knightly

Colin has spotted a bug : if you try to add or remove electrification, you will find that your money increases drastically.


jamespetts

Thank you for the report - problem found and will be fixed in the next version :-)
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Nathan Samson

WTF, this has been a problem in simutrans-standard a long time ago... and it was not in the 4.4 version...

Why is this problem always comping back...

jamespetts

Because the base values for the price of the way object is an unsigned integer. If that is used in the accounting without casting, where a - is used, it overflows and becomes a very high number. The fix is to cast it to a signed integer somewhere, but, if the code is changed around, somebody might well forget to cast it back again.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Nathan Samson

Quote from: jamespetts on July 05, 2009, 11:12:23 AM
Because the base values for the price of the way object is an unsigned integer. If that is used in the accounting without casting, where a - is used, it overflows and becomes a very high number. The fix is to cast it to a signed integer somewhere, but, if the code is changed around, somebody might well forget to cast it back again.

That explains it

Colin

Quote from: Nathan Samson on July 05, 2009, 11:56:43 AM
That explains it
Quote from: Nathan Samson on July 05, 2009, 10:28:47 AM
WTF, this has been a problem in simutrans-standard a long time ago... and it was not in the 4.4 version...

Why is this problem always coming back...

This post by Nathan is strange to me because, the many years that I have been playing Simutrans this is the first time I have come across this particular phenomenon. I must have missed a version somewhere down the track.
I may not agree with what you say, but I will defend to the death your right to say it

Thought for the day

When you are up to your backside in alligators, it is difficult to remind yourself that your initial objective was to drain the swamp.

Nathan Samson

Quote from: Colin on July 05, 2009, 04:44:07 PM
This post by Nathan is strange to me because, the many years that I have been playing Simutrans this is the first time I have come across this particular phenomenon. I must have missed a version somewhere down the track.

I think I made a mistake:
I interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks

Colin

Quote from: Nathan Samson on July 05, 2009, 09:25:45 PM
I think I made a mistake:
I interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks

I thought I had'nt seen this bug before. Yes it is electrification of Tram & Train lines.
I may not agree with what you say, but I will defend to the death your right to say it

Thought for the day

When you are up to your backside in alligators, it is difficult to remind yourself that your initial objective was to drain the swamp.

Nathan Samson

Quote from: Colin on July 05, 2009, 09:30:13 PM
I thought I had'nt seen this bug before. Yes it is electrification of Tram & Train lines.

Thats what I mean, this particular bug indeed didn't exist before (as far as I know), but a similar bug with powerlines did

cwlau9

This bug seems to be reappeared in ver 6.1 again.

jamespetts

#10
Thank you for the report - I will have to look into this...

Edit: I cannot reproduce this. Can you give more details about the circumstances in which it occurs?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Hanczar

QuoteI interpreted electrifaction as laying power lines between a power factory and another factory, but what was meant here was electrification of tracks
QuoteThats what I mean, this particular bug indeed didn't exist before (as far as I know), but a similar bug with powerlines did

For me it looks now exactly as this.  Construct power line on every title gives me ~43000000 $ .
It happens when I have exe built from sources, or downloaded from http://www.43-1.org/~simutrans/simutrans-exp/i386/.
I have used clean configs but all time the same.  Build 5.1 ( released 17 VII 2009 ) works ok , build 6.1 ( released 26 VII 2009 ) gives 43M per power line title.

Ubuntu 9.04, 32-bit
EDIT: I tested pak64 and pak128 on both problem is reproducible.

jamespetts

Ahh, sorry, I thought that it was to way electrification that reference was being made. I have found this and fixed it, and the fix will be available with the next release.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Hanczar

Could you commit fix to github? Current version because of this bug has very limited playability - no power lines at all

jamespetts

That'll be done to-morrow - I can't do it in advance of a release, because the Linux nightlies will then automatically build, and I don't want them being built with a half-baked version.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.