Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trains with 150% servicing interval #6254

Closed
DorpsGek opened this issue Mar 16, 2015 · 6 comments
Closed

Trains with 150% servicing interval #6254

DorpsGek opened this issue Mar 16, 2015 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Samu opened the ticket and wrote:

Trains 3, 4, 5 and 7 from Company 1 (my company) have a servicing interval of 150%. They are not being serviced or autoreplaced to the new engine model as ordered.

I remember these trains were from another company that was about to bankrupt and merged with mine. I also think they were previously a Wills 2-8-0 before the merging, which I autoreplaced to Kelling 3100. It was only now, when attempting to autoreplace from Kelling 3100 to MJS 1000, that I notice they have a weird servicing interval of 150%.

Attachments

Reported version: 1.5.0-beta2
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/6254
@DorpsGek
Copy link
Member Author

Alberth wrote:

Apparently, the error is that you can have a service interval percentage > 100% without ever explicitly setting it.
See also http://irclogs.qmsk.net/channels/openttd/link/1426512743# 1426512743


This comment was imported from FlySpray: https://bugs.openttd.org/task/6254#comment13822

@DorpsGek
Copy link
Member Author

DorpsGek commented May 2, 2015

Johnnei wrote:

Managed to reproduce bug with the following steps on r27256:

  1. Company A: Defaults maintenance to 15%
  2. Company B: Defaults maintenance to 150 days
  3. Company B Creates vehicle 1 (Tested with Kirby Paul Tank train engine)
  4. Company A buys-out Company B
  5. (!) Vehicle 1 now reports: [Default] maintenance 150 days (Which is different compared to the specified defaults of company A)
  6. Vehicle 1 auto-replaced to new model (Tested with Chaney 'Jibulee')
  7. Vehicle 1 now has a 150% maintenance interval

Proposed resolution:
Upon merging with a company forcibly set the interval settings if the default of `servint_ispercent` mismatches with the new company. (Resolves visual bug)
Changing `BaseConsist::CopyConsistPropertiesFrom` to also copy the interval settings. (This also affects order_backup!)

Proposed patch diff'ed against r27262

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6254#comment13887

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2015

frosch wrote:

About the change in base_consist.cpp:
Why the ToggleBit? As far as I can tell, vehicle_flags is always zero there, and various flags are copied. So, if should be a if (HasBit) SetBit(); line like all the others.

About the change in economy.cpp:
Your changes make all vehicles keep their previous service interval, by making them all use custom service intervals.
I think it should be the other way around. Preserve the "customness" and assign the new default service interval to all vehicles not using a custom interval.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6254#comment13893

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2015

Johnnei wrote:

base_consist.cpp:
The vehicle_flags is already filled with the company defaults at that point. So when I used HasBit/SetBit initially it didn't work as the defaults are mismatching. So the flag should be toggled to align with the source vehicle.

economy.cpp:
I've been considering that as well, but choose this way as you're buying up some others company's mess so you should fix the mess as well.
If you still prefer it the other way around then just say so and I'll try and make a new patch for it.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6254#comment13894

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2015

Johnnei wrote:

New patch which implements your suggestion. Custom settings will be stored, default will get overridden to new company defaults.
Patch is diff'ed against r27267

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6254#comment13895

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r27282. Thanks Johnnei


This comment was imported from FlySpray: https://bugs.openttd.org/task/6254

@DorpsGek DorpsGek added Autoreplace flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant