# HG changeset patch # User tron # Date 1150888382 0 # Node ID 566d63f3c5a201802d14d1a2a56d46b97d27ade6 # Parent b03689c406ff5b973aa6376f81d12004c6eebcee (svn r5325) Don't test something if we already know the result true, because the same test was performed just a few lines before diff -r b03689c406ff -r 566d63f3c5a2 waypoint.c --- a/waypoint.c Tue Jun 20 13:15:56 2006 +0000 +++ b/waypoint.c Wed Jun 21 11:13:02 2006 +0000 @@ -213,17 +213,16 @@ } if (flags & DC_EXEC) { - const StationSpec *statspec = NULL; + const StationSpec* statspec; + MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index); MarkTileDirtyByTile(tile); - if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP)) { - statspec = GetCustomStationSpec(STAT_CLASS_WAYP, GB(p1, 0, 8)); - } + statspec = GetCustomStationSpec(STAT_CLASS_WAYP, p1); if (statspec != NULL) { SetCustomWaypointSprite(tile); - wp->stat_id = GB(p1, 0, 8); + wp->stat_id = p1; wp->grfid = statspec->grfid; wp->localidx = statspec->localidx; } else {