Mercurial > hg > openttd
changeset 4051:1cfe19661d31 draft
(svn r5325) Don't test something if we already know the result true, because the same test was performed just a few lines before
author | tron <tron@openttd.org> |
---|---|
date | Wed, 21 Jun 2006 11:13:02 +0000 |
parents | dd841315c908 |
children | 5db227bfbebf |
files | waypoint.c |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/waypoint.c +++ b/waypoint.c @@ -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 {