summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-13 20:12:35 +0000
committertron <tron@openttd.org>2006-03-13 20:12:35 +0000
commit8505f4ed41dc7045cc1a6f36ed3d2d4f035dbb63 (patch)
tree373b43f0917517d23efff9f6e23d88cc761af1aa
parent23ae85048446ab85f89b66645a8df664cbd46c2d (diff)
downloadopenttd-8505f4ed41dc7045cc1a6f36ed3d2d4f035dbb63.tar.xz
(svn r3851) Rail depots only have an entrance at one side, therefore use UpdateSignalsOnSegment() instead of SetSignalsOnBothDir()
-rw-r--r--rail_cmd.c6
-rw-r--r--train_cmd.c5
2 files changed, 4 insertions, 7 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index 73c687041..1456e85a0 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -665,7 +665,7 @@ int32 CmdBuildTrainDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
d->xy = tile;
d->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
- SetSignalsOnBothDir(tile, (p2 & 1) ? 2 : 1);
+ UpdateSignalsOnSegment(tile, p2);
}
return cost + _price.build_train_depot;
@@ -1023,10 +1023,10 @@ static int32 RemoveTrainDepot(TileIndex tile, uint32 flags)
return CMD_ERROR;
if (flags & DC_EXEC) {
- Track track = TrackdirToTrack(DiagdirToDiagTrackdir(GetRailDepotDirection(tile)));
+ DiagDirection dir = GetRailDepotDirection(tile);
DoDeleteDepot(tile);
- SetSignalsOnBothDir(tile, track);
+ UpdateSignalsOnSegment(tile, dir);
}
return _price.remove_train_depot;
diff --git a/train_cmd.c b/train_cmd.c
index b14a9e0ff..8b0176a0b 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -3282,12 +3282,9 @@ void Train_Tick(Vehicle *v)
}
-static const byte _depot_track_ind[4] = {0,1,0,1};
-
-
void TrainEnterDepot(Vehicle *v, TileIndex tile)
{
- SetSignalsOnBothDir(tile, _depot_track_ind[GetRailDepotDirection(tile)]);
+ UpdateSignalsOnSegment(tile, GetRailDepotDirection(tile));
if (!IsFrontEngine(v)) v = GetFirstVehicleInChain(v);