News:

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

Bug: When you upgrade a stop, you win the lottery!

Started by Matthew, May 21, 2018, 12:34:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

Steps to reproduce:
1. Open this save game.
2. Switch to Allied Transport Company and find Darditch Slaughter-house Quay (should be [56,169]).
3. Note how much cash you have (should be about 60m Simucredits).
4. Build a Basic Bus Stop on the empty dirt-road tile between the school and the slaughter-house (should be [54, 169]).
5. Now upgrade it to Bus Stop with Shelter and Post Box.
6. Your cash will have increased by a large amount.

In my case, I receive 10m Simucredits, presumably because that's my starting_money; with default settings you might receive 250,000 Simucredits.

This was playing the Nightly from this morning (#657430b) on Windows 7.

For once, I feel reasonably certain that this is a bug rather than my mistake.  ;D
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

Thank you for the report - I think that I have now fixed this: I should be grateful if you could re-test and confirm.
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.

ACarlotti

Quote from: Matthew on May 21, 2018, 12:34:10 AMFor once, I feel reasonably certain that this is a bug rather than my mistake.
This one was my mistake - I said (or at least considered saying) I'd introduce some bugs while porting stuff from Standard.

Your starting finance was unrelated to this bug. There are two ways that building prices can be calculated in the pakset, one of which involves a magic constant of 2^31-1. The bug meant that in some circumstances the magic constant could be interpreted as a number of simucents. Divide by 2 (for the cost you recover from having the old station), and there's your approximately 10m simucredits.

DrSuperGood

Quoteone of which involves a magic constant of 2^31-1
You mean the largest positive number representable by a 32bit signed integer?

Matthew

Quote from: jamespetts on May 21, 2018, 09:31:27 PM
Thank you for the report - I think that I have now fixed this: I should be grateful if you could re-test and confirm.

Yes, this seems to be fixed with last night's build. Thank you for fixing this so swiftly!

Quote from: ACarlotti on May 22, 2018, 01:36:08 AM
This one was my mistake - I said (or at least considered saying) I'd introduce some bugs while porting stuff from Standard.

Your starting finance was unrelated to this bug. There are two ways that building prices can be calculated in the pakset, one of which involves a magic constant of 2^31-1. The bug meant that in some circumstances the magic constant could be interpreted as a number of simucents. Divide by 2 (for the cost you recover from having the old station), and there's your approximately 10m simucredits.

You did say bugs were likely, and this one has given me an excuse to start some new towns, so I'm not in the least bit annoyed. ;D And it's interesting to learn why that number popped up. If it had been a number like 1024 or 512, then I might have expected some kind of magic programming number, but the divide by 2 threw me off the scent. Thank you for explaining.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。