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

Broken savegame - Referencing invalid Vehicle #6230

Closed
DorpsGek opened this issue Feb 11, 2015 · 3 comments
Closed

Broken savegame - Referencing invalid Vehicle #6230

DorpsGek opened this issue Feb 11, 2015 · 3 comments
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay stale Stale issues

Comments

@DorpsGek
Copy link
Member

sawik opened the ticket and wrote:

Hi!

I've an old savegame (Sawik Transport, 2nd Aug 2170.sav, version 104) which i've been playing many years ago. When I try to open it in current openttd (compiled from trunk) i get "Broken savegame - Referencing invalid Vehicle" message. I examined the problem and found that it is shared order related issue. As of r16214 there is a code which should fix this but the code would execute too late, in AfterLoadVehicles (called from AfterLoadGame, called from DoLoad), and the message appears earlier, when calling SlFixPointers in DoLoad.

Thus, there is patch proposal and two savegames. I'm not sure whether 105 is a proper borderline save version (i copied this number from r16214), cause i have another savegame (Sawik Transport_0_7_5.sav, version 116) with the same problem and my fix works for this, too.

Attachments

Reported version: trunk
Operating system: All


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

andythenorth wrote:

Confirmed that both savegames fail to load (r27903).

I applied sawik's provided patch to r27903:
- works for Sawik Transport, 2nd Aug 2170.sav
- Sawik Transport_0_7_5.sav still fails to load for me


This comment was imported from FlySpray: https://bugs.openttd.org/task/6230#comment14661

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
@TrueBrain TrueBrain added patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay bug Something isn't working and removed bug from FlySpray labels Apr 13, 2018
@frosch123
Copy link
Member

That patch looks very wrong.

  1. All data is supposed to be zero-intialised.
  2. During loading a game pointers are first initialised as integer ids (reinterpret_cast).
  3. SlFixPointers then replaces the integers with the actual pointers.

Maybe the missing reference is initialised with vehicle 0 instead of INVALID_VEHICLE.

@frosch123 frosch123 removed the Core label Apr 14, 2018
@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth
Copy link
Contributor

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. I'm closing it as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun. Feel free to discuss in irc or request re-opening if you disagree. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay stale Stale issues
Projects
None yet
Development

No branches or pull requests

4 participants