News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

attempting to replace vehicles in simutrans-extended will charge you excessively

Started by johnson2008, May 28, 2024, 12:24:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

johnson2008

1.) System specs (CPU, memory, graphics, sound, operating system,
preferred screen resolution):
->OS: Windows 11 Pro 22H2
CPU: Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
RAM: 16 GB
SOUND: realtek sound
Graphics: AMD rx 570 4 GB VRAM , driver: andrenalin 23.11.1
2.) Simutrans version: simutrans-extended
->Versions 123.0.1 Extended nightly development build 14.21
May 7 2024 #5ed7a33

3.) Description of the found problem:
-> Clicking on the "replace" button from the vehicle window will always add the value of the vehicle to your financial report window even if no actions are performed, accidental use of this bug can easily bankrupt your new company


4.) How can this problem be reproduced?
(Note: if the problem can't be reproduced, there is only
a very small chance that it can be fixed.)
->1. start a new simutrans-extended game and build a railway or any other type of transport (doesn't matter which)
2. schedule the convoy and start it (it needs to be rolling, not being on a depot)
3. open the specific convoy window by clicking on it or opening it from the vehicle list
3.5(optional)you can open the finances windows to see the bug occurring.
4. click the replace "button"
5. see the bug and open the finances window if not, you will see the cost of new vehicles came from nowhere even if you never did any action with the replacement window


5.) What did you/the game do when the problem occurred?
(Only needed if (4) is left blank.)
->


6.) Effect on gameplay of the found problem?
-> You get extra, unnecessary charges for upgrading your convoys and other vehicles in the game, this can lead to bankruptcy in earlier, smaller companies


7.) Did you discover a workaround for the problem?
-> Yes, sending the convoy/vehicle to the depot and removing the trains or replacing and scheduling it manually will not inflict extra charges on your account


8.) Severity of the problem/urgency to fix it?
(One of high, medium, low or a more detailed description)
->low, it will just make upgrading vehicles and convoys much less convenient and time-consuming since the option for automatic upgrade is broken (bug above)

jamespetts

Thank you for your report. I note that you are using an older version of Simutrans-Extended, but this appears to be reproducible with the latest version. I will look into this when I get a moment after I have returned home from my holiday and have access to my normal debugging environment.
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.

Ranran

Sorry for the inconvenience.
And thank you for taking the trouble to report the bug. The accumulation of these efforts will improve the quality of the game.

It caused construction costs when creating a fictitious vehicle such as test_driver to restore a convoy that was reversed on the replace window.
I have submitted a pull request #659 for a patch that temporarily changes the owner of a fictional vehicle to the public player to work around the issue.
However, it will increase the construction cost of the public player, so other measures will need to be taken in the future. Ok, changing it to discard would solve it.

Ranran

I think I was able to fix this. Check out the pull request.

jamespetts

Quote from: Ranran on May 28, 2024, 02:36:06 PMI think I was able to fix this. Check out the pull request.
Excellent - thank you. Fix now incorporated.

I suspect that following Neroden's suggestion of reforming the financial accounting code would help to avoid this sort of issue in the long-term.
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.