(svn r16860) -Codechange: introduce a helper to assign a station spec to Waypoints

This commit is contained in:
rubidium
2009-07-17 20:21:24 +00:00
parent 84df3ba2b4
commit 06ea681b5f
4 changed files with 23 additions and 26 deletions

View File

@@ -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;