summaryrefslogtreecommitdiff
path: root/pathfind.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 /pathfind.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 'pathfind.c')
-rw-r--r--pathfind.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pathfind.c b/pathfind.c
index e73d3bfa2..8ab14c19b 100644
--- a/pathfind.c
+++ b/pathfind.c
@@ -145,7 +145,7 @@ static void TPFMode2(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi
// This addition will sometimes overflow by a single tile.
// The use of TILE_MASK here makes sure that we still point at a valid
// tile, and then this tile will be in the sentinel row/col, so GetTileTrackStatus will fail.
- tile = TILE_MASK(tile + TileOffsByDir(direction));
+ tile = TILE_MASK(tile + TileOffsByDiagDir(direction));
if (++tpf->rd.cur_length > 50)
return;
@@ -199,7 +199,7 @@ continue_here:;
*/
FindLengthOfTunnelResult FindLengthOfTunnel(TileIndex tile, DiagDirection dir)
{
- TileIndexDiff delta = TileOffsByDir(dir);
+ TileIndexDiff delta = TileOffsByDiagDir(dir);
uint z = GetTileZ(tile);
FindLengthOfTunnelResult flotr;
@@ -274,7 +274,7 @@ static void TPFMode1(TrackPathFinder* tpf, TileIndex tile, DiagDirection directi
}
tile = SkipToEndOfTunnel(tpf, tile, direction);
}
- tile += TileOffsByDir(direction);
+ tile += TileOffsByDiagDir(direction);
/* Check in case of rail if the owner is the same */
if (tpf->tracktype == TRANSPORT_RAIL) {
@@ -731,7 +731,7 @@ start_at:
tile_org = tile;
for (;;) {
assert(direction <= 3);
- tile += TileOffsByDir(direction);
+ tile += TileOffsByDiagDir(direction);
// too long search length? bail out.
if (si.cur_length >= tpf->maxlength) {