mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r5325) Don't test something if we already know the result true, because the same test was performed just a few lines before
This commit is contained in:
parent
eebcec949b
commit
b8778e6341
@ -213,17 +213,16 @@ int32 CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
const StationSpec *statspec = NULL;
|
const StationSpec* statspec;
|
||||||
|
|
||||||
MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index);
|
MakeRailWaypoint(tile, GetTileOwner(tile), axis, GetRailType(tile), wp->index);
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
|
||||||
if (GB(p1, 0, 8) < GetNumCustomStations(STAT_CLASS_WAYP)) {
|
statspec = GetCustomStationSpec(STAT_CLASS_WAYP, p1);
|
||||||
statspec = GetCustomStationSpec(STAT_CLASS_WAYP, GB(p1, 0, 8));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (statspec != NULL) {
|
if (statspec != NULL) {
|
||||||
SetCustomWaypointSprite(tile);
|
SetCustomWaypointSprite(tile);
|
||||||
wp->stat_id = GB(p1, 0, 8);
|
wp->stat_id = p1;
|
||||||
wp->grfid = statspec->grfid;
|
wp->grfid = statspec->grfid;
|
||||||
wp->localidx = statspec->localidx;
|
wp->localidx = statspec->localidx;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user