diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 14645f93de..cd080ca538 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -32,6 +32,7 @@ #include "date_func.h" #include "newgrf_debug.h" #include "vehicle_func.h" +#include "station_func.h" #include "table/strings.h" #include "table/object_land.h" @@ -121,7 +122,9 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u Company::Get(owner)->infrastructure.water++; DirtyCompanyInfrastructureWindows(owner); } + bool remove = IsDockingTile(t); MakeObject(t, owner, o->index, wc, Random()); + if (remove) RemoveDockingTile(t); MarkTileDirtyByTile(t); } diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 02a221bb60..6a42ea81c6 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3106,8 +3106,8 @@ bool AfterLoadGame() } } - if (IsSavegameVersionBefore(SLV_DOCK_DOCKINGTILES)) { - /* All tiles around docks may be docking tiles. */ + if (IsSavegameVersionBefore(SLV_REPAIR_OBJECT_DOCKING_TILES)) { + /* Placing objects on docking tiles was not updating adjacent station's docking tiles. */ for (Station *st : Station::Iterate()) { if (st->ship_station.tile != INVALID_TILE) UpdateStationDockingTiles(st); } diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index 382d77f1a5..0d4e0fb984 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -338,7 +338,8 @@ enum SaveLoadVersion : uint16 { SLV_TABLE_CHUNKS, ///< 295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE. SLV_SCRIPT_INT64, ///< 296 PR#9415 SQInteger is 64bit but was saved as 32bit. SLV_LINKGRAPH_TRAVEL_TIME, ///< 297 PR#9457 v12.0-RC1 Store travel time in the linkgraph. - SLV_DOCK_DOCKINGTILES, ///< 298 PR#9578 v12.0 All tiles around docks may be docking tiles. + SLV_DOCK_DOCKINGTILES, ///< 298 PR#9578 All tiles around docks may be docking tiles. + SLV_REPAIR_OBJECT_DOCKING_TILES, ///< 299 PR#9594 v12.0 Fixing issue with docking tiles overlapping objects. SL_MAX_VERSION, ///< Highest possible saveload version };