diff options
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r-- | src/waypoint_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 29880a761..30f23ac9e 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -184,6 +184,8 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1 } wp->owner = owner; + wp->rect.BeforeAddTile(tile, StationRect::ADD_TRY); + bool reserved = HasBit(GetRailReservationTrackBits(tile), AxisToTrack(axis)); MakeRailWaypoint(tile, owner, wp->index, axis, 0, GetRailType(tile)); SetRailStationReservation(tile, reserved); @@ -249,6 +251,7 @@ CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justre if (v != NULL) TryPathReserve(v, true); DeallocateSpecFromStation(wp, specindex); + wp->rect.AfterRemoveTile(wp, tile); } return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot); @@ -296,6 +299,7 @@ CommandCost CmdBuildBuoy(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 wp->xy = tile; InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index); } + wp->rect.BeforeAddTile(tile, StationRect::ADD_TRY); wp->string_id = STR_SV_STNAME_BUOY; @@ -344,6 +348,8 @@ CommandCost RemoveBuoy(TileIndex tile, DoCommandFlag flags) MakeWaterKeepingClass(tile, GetTileOwner(tile)); MarkTileDirtyByTile(tile); + wp->rect.AfterRemoveTile(wp, tile); + wp->UpdateVirtCoord(); wp->delete_ctr = 0; } |