FS#6230 - Broken savegame - Referencing invalid Vehicle

Attached to Project: OpenTTD
Opened by KrzSaw (sawik) - Wednesday, 11 February 2015, 10:00 GMT
Last edited by andythenorth (andythenorth) - Thursday, 31 August 2017, 06:36 GMT
Type Bug
Category Core
Status With patch
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No



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.

This task depends upon

Comment by andythenorth (andythenorth) - Thursday, 31 August 2017, 06:36 GMT
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