summaryrefslogtreecommitdiff
path: root/src/waypoint_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-21 11:20:34 +0000
committerrubidium <rubidium@openttd.org>2009-07-21 11:20:34 +0000
commited5ced71c852387aec030acc19ad096e55bcbd82 (patch)
tree087c8bed10e5e62eeed8052eaf781f1ec60c544c /src/waypoint_cmd.cpp
parent43eda3dfbf45a8f5060aaca3da9b8cad59a1aad8 (diff)
downloadopenttd-ed5ced71c852387aec030acc19ad096e55bcbd82.tar.xz
(svn r16897) -Codechange: use the 'generic' station spec to station allocation for waypoints too
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r--src/waypoint_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp
index 2f10c7dea..882ba6097 100644
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -190,7 +190,7 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1
SetDepotWaypointReservation(tile, reserved);
MarkTileDirtyByTile(tile);
- wp->AssignStationSpec(p1);
+ AllocateSpecToStation(GetCustomStationSpec(STAT_CLASS_WAYP, p1), wp, true);
wp->delete_ctr = 0;
wp->build_date = _date;
@@ -246,6 +246,8 @@ CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justre
}
YapfNotifyTrackLayoutChange(tile, track);
if (v != NULL) TryPathReserve(v, true);
+
+ DeallocateSpecFromStation(wp, wp->num_specs > 0 ? 1 : 0);
}
return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot);