diff options
author | tron <tron@openttd.org> | 2005-01-05 13:32:03 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-05 13:32:03 +0000 |
commit | e4cf2ba1b304a0b424a50a6143243172b9c5264d (patch) | |
tree | b9a5829b3d37c53a2de48d1ef28960f41804f4dc /train_cmd.c | |
parent | 0a37e6202b4b2633ce0bf13ce3f71fdcfe8a8ce0 (diff) | |
download | openttd-e4cf2ba1b304a0b424a50a6143243172b9c5264d.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.c | 8 |
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]; |