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
Fix: Incorrect save/load array size of Town::cargo_accepted #8157
Fix: Incorrect save/load array size of Town::cargo_accepted #8157
Conversation
d61ee9e
to
5cb9780
Compare
In 11ab3c4 the number of cargo types was changed from 32 to 64. The save/load of Town::cargo_accepted was not updated, such that only half of the data structure is saved/loaded in savegame versions 199 to 218. Discard and regenerate data from all savegame versions prior to 219.
Save game bump means it can't be backported, which is a shame. But if it's been broken since 1.9 anyway, I guess it's not a huge rush... |
IMO Town::cargo_accepted should be just removed completely. It's not worth to waste so many resources and effort just to generate some subsidies. |
I think it's possible to backport the discard and regenerate part without the bump, and still save wrong data in 1.10 branch. While master will save correctly and with the bump. |
I have a simplified version of this PR. It should have the same effect while being easier to backport. |
Having thought about more it I'm inclined to agree with you, though presumably this wouldn't be backportable to 1.10. Town::cargo_produced should also be binned for much the same reason. |
I'm not opposed to having a "1.10-only commit", though it would be cleaner (easier to track, etc) to have a backportable fix first, then rewrite it to do it "properly" |
The problem with this is that network clients would also regenerate it. Having stuff refreshed both monthly and on load is a bit of an anti-pattern which creates opportunities for desyncs. |
In 11ab3c4 the number of cargo types was changed from 32 to 64.
The save/load of Town::cargo_accepted was not updated, such that
only half of the data structure is saved/loaded in savegame versions
199 to 218.
Discard and regenerate data from all savegame versions prior to 219.