summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-05 13:32:03 +0000
committertron <tron@openttd.org>2005-01-05 13:32:03 +0000
commit67161506ad98a7636d3c9f141b5595481d079e93 (patch)
treeb9a5829b3d37c53a2de48d1ef28960f41804f4dc /train_cmd.c
parent2543158c8e0d105148bc38522fba43aa3428d76a (diff)
downloadopenttd-67161506ad98a7636d3c9f141b5595481d079e93.tar.xz
(svn r1386) Move TileIndexDiff to map.h
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 63d541338..257d8714c 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -984,7 +984,7 @@ static void ReverseTrainDirection(Vehicle *v)
t = (t - 1) & 3;
}
/* Calculate next tile */
- tile += _tileoffs_by_dir[t];
+ tile += TileOffsByDir(t);
/* Test if we have a rail/road-crossing */
if (IS_TILETYPE(tile, MP_STREET) && (_map5[tile] & 0xF0)==0x10) {
/* Check if there is a train on the tile itself */
@@ -1471,7 +1471,7 @@ static byte ChooseTrainTrack(Vehicle *v, uint tile, int direction, byte trackbit
fd.best_bird_dist = (uint)-1;
fd.best_track_dist = (uint)-1;
fd.best_track = 0xFF;
- NewTrainPathfind(tile - _tileoffs_by_dir[direction], direction, (TPFEnumProc*)TrainTrackFollower, &fd, NULL);
+ NewTrainPathfind(tile - TileOffsByDir(direction), direction, (TPFEnumProc*)TrainTrackFollower, &fd, NULL);
// printf("Train %d %s\n", v->unitnumber, fd.best_track_dist == -1 ? "NOTFOUND" : "FOUND");
@@ -2271,7 +2271,7 @@ red_light: {
v->subspeed = 0;
v->progress = 255-10;
if (++v->load_unload_time_rem < _patches.wait_twoway_signal * 73) {
- uint o_tile = gp.new_tile + _tileoffs_by_dir[dir>>1];
+ uint o_tile = gp.new_tile + TileOffsByDir(dir >> 1);
/* check if a train is waiting on the other side */
if (VehicleFromPos(o_tile, (void*)( (o_tile<<8) | (dir^4)), (VehicleFromPosProc*)CheckVehicleAtSignal) == NULL)
return;
@@ -2452,7 +2452,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
t = (t - 1) & 3;
}
/* Calculate next tile */
- tile += _tileoffs_by_dir[t];
+ tile += TileOffsByDir(t);
// determine the track status on the next tile.
ts = GetTileTrackStatus(tile, TRANSPORT_RAIL) & _reachable_tracks[t];