From 67161506ad98a7636d3c9f141b5595481d079e93 Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 5 Jan 2005 13:32:03 +0000 Subject: (svn r1386) Move TileIndexDiff to map.h Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir() --- train_cmd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'train_cmd.c') 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]; -- cgit v1.2.3-54-g00ecf