summaryrefslogtreecommitdiff
path: root/src/waypoint_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-29 22:13:12 +0000
committerrubidium <rubidium@openttd.org>2009-07-29 22:13:12 +0000
commita52cd653d454170f8163ff2a9f7836c4d8dd5bb6 (patch)
tree238827cbcd3d24af7428f8cb9de0aab9d721d90a /src/waypoint_cmd.cpp
parent959a5e690bb1ca14c4bbc9cc60cdf27700f261f5 (diff)
downloadopenttd-a52cd653d454170f8163ff2a9f7836c4d8dd5bb6.tar.xz
(svn r16989) -Codechange: unify the code for demolishing (dynamite) stations and waypoints.
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r--src/waypoint_cmd.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp
index 51db1a7ef..f0186b00f 100644
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -210,48 +210,6 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1
return CommandCost(EXPENSES_CONSTRUCTION, _price.build_train_depot);
}
-/**
- * Remove a waypoint
- * @param tile from which to remove waypoint
- * @param flags type of operation
- * @param justremove will indicate if it is removed from rail or if rails are removed too
- * @pre IsRailWaypointTile(tile)
- * @return cost of operation or error
- */
-CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags)
-{
- /* Make sure it's a waypoint */
- if (!IsRailWaypointTile(tile) ||
- (!CheckTileOwnership(tile) && _current_company != OWNER_WATER) ||
- !EnsureNoVehicleOnGround(tile)) {
- return CMD_ERROR;
- }
-
- if (flags & DC_EXEC) {
- Track track = GetRailStationTrack(tile);
- Waypoint *wp = Waypoint::GetByTile(tile);
-
- wp->sign.MarkDirty();
- wp->facilities &= ~FACIL_TRAIN;
-
- Train *v = NULL;
- uint specindex = GetCustomStationSpecIndex(tile);
- if (HasStationReservation(tile)) {
- v = GetTrainForReservation(tile, track);
- if (v != NULL) FreeTrainTrackReservation(v);
- }
- DoClearSquare(tile);
- AddTrackToSignalBuffer(tile, track, wp->owner);
- YapfNotifyTrackLayoutChange(tile, track);
- if (v != NULL) TryPathReserve(v, true);
-
- DeallocateSpecFromStation(wp, specindex);
- wp->rect.AfterRemoveTile(wp, tile);
- }
-
- return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot);
-}
-
/** Build a buoy.
* @param tile tile where to place the bouy
* @param flags operation to perform