summaryrefslogtreecommitdiff
path: root/src/waypoint_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-26 16:17:49 +0000
committerrubidium <rubidium@openttd.org>2009-07-26 16:17:49 +0000
commit2dd998ab06d0f79445bf96239da9944fa30b7578 (patch)
treed230b550010fe91e42a879808170d09958464f67 /src/waypoint_cmd.cpp
parent0081bb9a960473bd1e4f4891416f401d1f50e5b8 (diff)
downloadopenttd-2dd998ab06d0f79445bf96239da9944fa30b7578.tar.xz
(svn r16962) -Codechange: more work towards multi tile waypoints
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r--src/waypoint_cmd.cpp6
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;
}