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
Autoreplace does not report failures due to refittability #8153
Comments
Some of them go to depot to refit and other ones pass close to the depots so they should have chances to enter for maintenance. I also tried to send them manually but they never get replaced. Dozens of other ships (even on the same route I think) got replaced correctly but these ones are stuck somehow. It happened as well in another game to a friend of mine, this time with road vehicles. |
I traced through the code, it turns out the autoreplace fails (silently) because the replacement vehicle can not be refitted to the correct cargo types required for the vehicle's current cargo or any refit order the vehicle has. The bug here isn't that the replacement fails, but that you don't get any feedback why it fails. |
So the message would be something like "Autorenew failed on Ship 3 ... Could not refit vehicle" plus an optional "to all cargoes" in the case of refit orders? |
There's two cases to report really. Ideas for error messages:
A bonus feature would be to check all orders for refit-compatibility instead of bailing on first failure. This is where the check happens: OpenTTD/src/autoreplace_cmd.cpp Lines 295 to 297 in e31def1
|
Happy to try and tackle this one! I've added a string and put it into For more information we'll have to modify the variables that are passed to the string template, I can see this is done here: Lines 1058 to 1067 in c972a63
Should I be adding some extra logic here to set a third parameter (cargo type) if the error message is my new one? Seems like there's a couple of conditionals for building the message depending on the error here already. Made a barebones save for easier testing too - bugboats.zip |
Feel free to open a PR @Chr12t0pher, will be easier to discuss with the code |
…carry the cargo
Version of OpenTTD
1.10.1
Expected result
When I'm setting some vehicles to be replaced with some policy (either immediately or when they're old) I expect them to be replaced
Actual result
Sometimes it happens that some vehicles get "stuck" indefinitely and never get replaced.
Steps to reproduce
The text was updated successfully, but these errors were encountered: