@@ -496,13 +496,18 @@ static void ClearOldMap3(TileIndex t)
}
static Town *RemapTown(TileIndex fallback)
{
/* In some cases depots, industries and stations could refer to a missing town. */
Town *t = Town::GetIfValid(RemapTownIndex(_old_town_index));
if (t == nullptr) t = CalcClosestTownFromTile(fallback);
if (t == nullptr) {
/* In case the town that was refered to does not exist, find the closest.
* However, this needs the kd-tree to be present. */
RebuildTownKdtree();
t = CalcClosestTownFromTile(fallback);
return t;
static void ReadTTDPatchFlags()
if (_read_ttdpatch_flags) return;
Status change: