summaryrefslogtreecommitdiff
path: root/src/waypoint_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-17 20:21:24 +0000
committerrubidium <rubidium@openttd.org>2009-07-17 20:21:24 +0000
commit06ea681b5fa361b34000351bcd248ee46c2a939e (patch)
treebcda240773c51bf9617fea6bf60e11631c74e150 /src/waypoint_cmd.cpp
parent84df3ba2b40054b751fd9d39c3a9b3a7589422b8 (diff)
downloadopenttd-06ea681b5fa361b34000351bcd248ee46c2a939e.tar.xz
(svn r16860) -Codechange: introduce a helper to assign a station spec to Waypoints
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r--src/waypoint_cmd.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp
index cddd4a7ac..1e8094162 100644
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -190,18 +190,7 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, DoCommandFlag flags, uint32 p1
SetDepotWaypointReservation(tile, reserved);
MarkTileDirtyByTile(tile);
- const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, p1);
-
- if (statspec != NULL) {
- wp->spec.spec = statspec;
- wp->spec.grfid = statspec->grffile->grfid;
- wp->spec.localidx = statspec->localidx;
- } else {
- /* Specified custom graphics do not exist, so use default. */
- wp->spec.spec = NULL;
- wp->spec.grfid = 0;
- wp->spec.localidx = 0;
- }
+ wp->AssignStationSpec(p1);
wp->delete_ctr = 0;
wp->build_date = _date;