From 80814dbb1d01f651ba7c60547dc1b52c1c209378 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 5 Sep 2006 23:21:41 +0000 Subject: (svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts DiagDirections, and add TileOffsByDir that handles Directions. -Codechange: Make the treeloop use TileOffsByDir(). --- roadveh_cmd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'roadveh_cmd.c') diff --git a/roadveh_cmd.c b/roadveh_cmd.c index dbbdd8dd4..a01e04931 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -303,7 +303,7 @@ static bool EnumRoadSignalFindDepot(TileIndex tile, void* data, int track, uint { RoadFindDepotData* rfdd = data; - tile += TileOffsByDir(_road_pf_directions[track]); + tile += TileOffsByDiagDir(_road_pf_directions[track]); if (IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_DEPOT && @@ -965,7 +965,7 @@ static void RoadVehCheckOvertake(Vehicle *v, Vehicle *u) od.tile = v->tile; if (FindRoadVehToOvertake(&od)) return; - od.tile = v->tile + TileOffsByDir(DirToDiagDir(v->direction)); + od.tile = v->tile + TileOffsByDiagDir(DirToDiagDir(v->direction)); if (FindRoadVehToOvertake(&od)) return; if (od.u->cur_speed == 0 || od.u->vehstatus& VS_STOPPED) { @@ -1126,7 +1126,7 @@ static int RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection enterdir trackdir = DiagdirToDiagTrackdir(enterdir); //debug("Finding path. Enterdir: %d, Trackdir: %d", enterdir, trackdir); - ftd = PerfNPFRouteToStationOrTile(tile - TileOffsByDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE); + ftd = PerfNPFRouteToStationOrTile(tile - TileOffsByDiagDir(enterdir), trackdir, &fstd, TRANSPORT_ROAD, v->owner, INVALID_RAILTYPE); if (ftd.best_trackdir == 0xff) { /* We are already at our target. Just do something */ //TODO: maybe display error? @@ -1154,7 +1154,7 @@ do_it:; /* When we are heading for a depot or station, we just * pretend we are heading for the tile in front, we'll * see from there */ - desttile += TileOffsByDir(dir); + desttile += TileOffsByDiagDir(dir); if (desttile == tile && bitmask & _road_pf_table_3[dir]) { /* If we are already in front of the * station/depot and we can get in from here, @@ -1349,7 +1349,7 @@ static void RoadVehController(Vehicle *v) // switch to another tile if (rd.x & 0x80) { - TileIndex tile = v->tile + TileOffsByDir(rd.x & 3); + TileIndex tile = v->tile + TileOffsByDiagDir(rd.x & 3); int dir = RoadFindPathToDest(v, tile, rd.x & 3); uint32 r; Direction newdir; -- cgit v1.2.3-54-g00ecf