diff options
author | smatz <smatz@openttd.org> | 2008-04-17 18:24:45 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-04-17 18:24:45 +0000 |
commit | 059e94e355c9172a42b70ff20b4b8a87dd4889ae (patch) | |
tree | 1d21e0ab2e3402600dc144e6cfc0d1e0b5725da1 /src/train_cmd.cpp | |
parent | e098b50379219aeb0b8d22d652a3de514759eb3d (diff) | |
download | openttd-059e94e355c9172a42b70ff20b4b8a87dd4889ae.tar.xz |
(svn r12753) -Codechange: do not use IsDepotTypeTile() where simpler function can be used
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 9f05d9af3..408d88487 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -678,7 +678,7 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 /* Check if the train is actually being built in a depot belonging * to the player. Doesn't matter if only the cost is queried */ if (!(flags & DC_QUERY_COST)) { - if (!IsDepotTypeTile(tile, TRANSPORT_RAIL)) return CMD_ERROR; + if (!IsRailDepotTile(tile)) return CMD_ERROR; if (!IsTileOwner(tile, _current_player)) return CMD_ERROR; } @@ -806,7 +806,7 @@ int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped) TileIndex tile = v->tile; /* check if stopped in a depot */ - if (!IsDepotTypeTile(tile, TRANSPORT_RAIL) || v->cur_speed != 0) return -1; + if (!IsRailDepotTile(tile) || v->cur_speed != 0) return -1; int count = 0; for (; v != NULL; v = v->Next()) { @@ -1787,7 +1787,7 @@ static void AdvanceWagonsAfterSwap(Vehicle *v) static void ReverseTrainDirection(Vehicle *v) { - if (IsDepotTypeTile(v->tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(v->tile)) { InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); } @@ -1807,7 +1807,7 @@ static void ReverseTrainDirection(Vehicle *v) AdvanceWagonsAfterSwap(v); - if (IsDepotTypeTile(v->tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(v->tile)) { InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); } @@ -2035,7 +2035,7 @@ static TrainFindDepotData FindClosestTrainDepot(Vehicle *v, int max_distance) tfdd.reverse = false; TileIndex tile = v->tile; - if (IsDepotTypeTile(tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(tile)) { tfdd.tile = tile; tfdd.best_length = 0; return tfdd; @@ -2154,7 +2154,7 @@ static void HandleLocomotiveSmokeCloud(const Vehicle *v) } /* No smoke in depots or tunnels */ - if (IsDepotTypeTile(v->tile, TRANSPORT_RAIL) || IsTunnelTile(v->tile)) continue; + if (IsRailDepotTile(v->tile) || IsTunnelTile(v->tile)) continue; /* No sparks for electric vehicles on nonelectrified tracks */ if (!HasPowerOnRail(v->u.rail.railtype, GetTileRailType(v->tile))) continue; @@ -3149,7 +3149,7 @@ static void DeleteLastWagon(Vehicle *v) if (IsLevelCrossingTile(tile)) UpdateLevelCrossing(tile); /* Update signals */ - if (IsTileType(tile, MP_TUNNELBRIDGE) || IsDepotTypeTile(tile, TRANSPORT_RAIL)) { + if (IsTileType(tile, MP_TUNNELBRIDGE) || IsRailDepotTile(tile)) { UpdateSignalsOnSegment(tile, INVALID_DIAGDIR, owner); } else { SetSignalsOnBothDir(tile, (Track)(FIND_FIRST_BIT(track)), owner); @@ -3311,7 +3311,7 @@ static bool TrainCanLeaveTile(const Vehicle *v) } /* entering a depot? */ - if (IsDepotTypeTile(tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(tile)) { DiagDirection dir = ReverseDiagDir(GetRailDepotDirection(tile)); if (DiagDirToDir(dir) == v->direction) return false; } |