summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-09-05 23:21:41 +0000
committerDarkvater <darkvater@openttd.org>2006-09-05 23:21:41 +0000
commit80814dbb1d01f651ba7c60547dc1b52c1c209378 (patch)
treef2f14fca9ac095b0bf6b46615035b8c207e3ce66 /roadveh_cmd.c
parent516d412a77de7fb3d2278515d59a0c46bb9b461b (diff)
downloadopenttd-80814dbb1d01f651ba7c60547dc1b52c1c209378.tar.xz
(svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts
DiagDirections, and add TileOffsByDir that handles Directions. -Codechange: Make the treeloop use TileOffsByDir().
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c10
1 files changed, 5 insertions, 5 deletions
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;