-
-
Notifications
You must be signed in to change notification settings - Fork 949
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
Crash: loading savegame #6605
Comments
andythenorth wrote:
This comment was imported from FlySpray: https://bugs.openttd.org/task/6605#comment14517 |
Wolf01 wrote:
This comment was imported from FlySpray: https://bugs.openttd.org/task/6605#comment14522 |
Loading the saved game still crashes in OpenTTD 1.8.0 on Win 7 Ultimate. |
With up to date master build:-
Same assertion as #6507 - same underlying cause? |
Stack-dump on loading the game:
that is, non-existing town being accessed. |
Town index numbers get messed up in
|
thingie("5");
if (IsSavegameVersionBefore(128)) {
const Depot *d;
FOR_ALL_DEPOTS(d) {
_m[d->xy].m2 = d->index;
if (IsTileType(d->xy, MP_WATER)) _m[GetOtherShipDepotTile(d->xy)].m2 = d->index;
}
}
thingie("5b"); where static void thingie(const char *name)
{
const TileIndex broken = 37809;
if (broken >= MapSize()) return;
if (!(IsTileType(broken, MP_HOUSE) || (IsTileType(broken, MP_ROAD) && !IsRoadDepot(broken)))) return;
printf("%s: GetTownIndex(tile)=%d\n", name, GetTownIndex(broken));
} Output:
the other output comes from other points in the afterload code, which are not further relevant. |
EDIT: After some more thought, I think the above conclusion is actually not true (but perhaps also not false). The code already used |
Loading the saved game still crashes in OpenTTD 1.9.0-beta2 on Win 7 Ultimate with the same assertion as in the initial comment ( |
This issue has been automatically marked as stale because it has not had any activity in the last two months. |
I've been doing some digging on this, and it seems there's currently another bug on top of this one, in current master (5b0ce8c)
(afterload.cpp line number different due to debug additions, but it's the This is due to This can be worked around by adding an explicit GroupStatistics::UpdateAfterLoad() call just before the previously mentioned block, but I'm not sure whether that's a good solution - perhaps things are being loaded in the wrong order generally? |
OK, with the previous issue worked around (@PeterN pointed out that it was picking up my new game GRF settings...), and I find the following: There are 5 invalid depot tiles in the game, that is, depots where their tile types don't match:
Visually looking at the map, now that I can actually load the game, all these tiles look like they could've contained depots at some point in the past, as they're all next to a rail line (now contain a mixture of grass or houses) Not sure where to go next, simply |
james1101 opened the ticket and wrote:
Attachments
Reported version: 1.7.1
Operating system: Windows
This issue was imported from FlySpray: https://bugs.openttd.org/task/6605
The text was updated successfully, but these errors were encountered: