Fix crash when loading old savegames with buoys

This commit is contained in:
Jonathan G Rennison
2017-09-20 19:51:25 +01:00
parent be37aad470
commit a9ca7c1ead

View File

@@ -1025,9 +1025,13 @@ bool AfterLoadGame()
if (IsOilRig(st->dock_station.tile)) { if (IsOilRig(st->dock_station.tile)) {
/* Set dock station tile to dest tile instead of station. */ /* Set dock station tile to dest tile instead of station. */
st->docks = new Dock(st->dock_station.tile, st->dock_station.tile + ToTileIndexDiff({ 1, 0 })); st->docks = new Dock(st->dock_station.tile, st->dock_station.tile + ToTileIndexDiff({ 1, 0 }));
} } else if (IsDock(st->dock_station.tile)) {
else { /* A normal two-tiles dock. */ /* A normal two-tiles dock. */
st->docks = new Dock(st->dock_station.tile, TileAddByDiagDir(st->dock_station.tile, GetDockDirection(st->dock_station.tile))); st->docks = new Dock(st->dock_station.tile, TileAddByDiagDir(st->dock_station.tile, GetDockDirection(st->dock_station.tile)));
} else if (IsBuoy(st->dock_station.tile)) {
/* A buoy. */
} else {
NOT_REACHED();
} }
} }
} }