diff -r c1391c8ed5c6 -r 52b4a9006029 src/train_cmd.cpp --- a/src/train_cmd.cpp Wed Apr 16 22:34:14 2008 +0000 +++ b/src/train_cmd.cpp Fri Apr 18 19:55:13 2008 +0000 @@ -20,7 +20,8 @@ #include "engine_func.h" #include "player_func.h" #include "player_base.h" -#include "depot.h" +#include "depot_base.h" +#include "depot_func.h" #include "waypoint.h" #include "vehicle_gui.h" #include "train.h" @@ -678,7 +679,7 @@ /* 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 (!IsTileDepotType(tile, TRANSPORT_RAIL)) return CMD_ERROR; + if (!IsRailDepotTile(tile)) return CMD_ERROR; if (!IsTileOwner(tile, _current_player)) return CMD_ERROR; } @@ -806,7 +807,7 @@ TileIndex tile = v->tile; /* check if stopped in a depot */ - if (!IsTileDepotType(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()) { @@ -1303,7 +1304,7 @@ * @param p2 the selling mode * - p2 = 0: only sell the single dragged wagon/engine (and any belonging rear-engines) * - p2 = 1: sell the vehicle and all vehicles following it in the chain - if the wagon is dragged, don't delete the possibly belonging rear-engine to some front + * if the wagon is dragged, don't delete the possibly belonging rear-engine to some front * - p2 = 2: when selling attached locos, rearrange all vehicles after it to separate lines; * all wagons of the same type will go on the same line. Used by the AI currently */ @@ -1787,7 +1788,7 @@ static void ReverseTrainDirection(Vehicle *v) { - if (IsTileDepotType(v->tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(v->tile)) { InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); } @@ -1807,7 +1808,7 @@ AdvanceWagonsAfterSwap(v); - if (IsTileDepotType(v->tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(v->tile)) { InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); } @@ -2035,7 +2036,7 @@ tfdd.reverse = false; TileIndex tile = v->tile; - if (IsTileDepotType(tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(tile)) { tfdd.tile = tile; tfdd.best_length = 0; return tfdd; @@ -2154,7 +2155,7 @@ } /* No smoke in depots or tunnels */ - if (IsTileDepotType(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 +3150,7 @@ if (IsLevelCrossingTile(tile)) UpdateLevelCrossing(tile); /* Update signals */ - if (IsTileType(tile, MP_TUNNELBRIDGE) || IsTileDepotType(tile, TRANSPORT_RAIL)) { + if (IsTileType(tile, MP_TUNNELBRIDGE) || IsRailDepotTile(tile)) { UpdateSignalsOnSegment(tile, INVALID_DIAGDIR, owner); } else { SetSignalsOnBothDir(tile, (Track)(FIND_FIRST_BIT(track)), owner); @@ -3206,7 +3207,7 @@ if (state <= 240 && !(v->tick_counter & 3)) ChangeTrainDirRandomly(v); - if (state >= 4440 && !(v->tick_counter&0x1F)) { + if (state >= 4440 && !(v->tick_counter & 0x1F)) { DeleteLastWagon(v); InvalidateWindow(WC_REPLACE_VEHICLE, (v->group_id << 16) | VEH_TRAIN); } @@ -3311,7 +3312,7 @@ } /* entering a depot? */ - if (IsTileDepotType(tile, TRANSPORT_RAIL)) { + if (IsRailDepotTile(tile)) { DiagDirection dir = ReverseDiagDir(GetRailDepotDirection(tile)); if (DiagDirToDir(dir) == v->direction) return false; }