215 if (flags & DC_EXEC) { |
215 if (flags & DC_EXEC) { |
216 const StationSpec *statspec = NULL; |
216 const StationSpec *statspec = NULL; |
217 MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index); |
217 MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index); |
218 MarkTileDirtyByTile(tile); |
218 MarkTileDirtyByTile(tile); |
219 |
219 |
220 if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP)) |
220 if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP)) { |
221 statspec = GetCustomStationSpec(STAT_CLASS_WAYP, GB(p1, 0, 8)); |
221 statspec = GetCustomStationSpec(STAT_CLASS_WAYP, GB(p1, 0, 8)); |
|
222 } |
222 |
223 |
223 if (statspec != NULL) { |
224 if (statspec != NULL) { |
224 SetCustomWaypointSprite(tile); |
225 SetCustomWaypointSprite(tile); |
225 wp->stat_id = GB(p1, 0, 8); |
226 wp->stat_id = GB(p1, 0, 8); |
226 wp->grfid = statspec->grfid; |
227 wp->grfid = statspec->grfid; |