Fix #8132: Corrupted savegame crashing OpenTTD on load

This commit is contained in:
glx 2020-05-10 19:40:51 +02:00 committed by Charles Pigott
parent 0ed00ae111
commit 5aa6351042

View File

@ -898,6 +898,9 @@ bool AfterLoadGame()
case MP_STATION: { case MP_STATION: {
BaseStation *bst = BaseStation::GetByTile(t); BaseStation *bst = BaseStation::GetByTile(t);
/* Sanity check */
if (bst->owner != GetTileOwner(t)) SlErrorCorrupt("Wrong owner for station tile");
/* Set up station spread */ /* Set up station spread */
bst->rect.BeforeAddTile(t, StationRect::ADD_FORCE); bst->rect.BeforeAddTile(t, StationRect::ADD_FORCE);