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 1072c74bc4
commit a089c876ab
1 changed files with 3 additions and 0 deletions

View File

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