(svn r15789) -Codechange: Add DiagdirBetweenTiles() and use it.

This commit is contained in:
frosch
2009-03-21 21:43:23 +00:00
parent 2f1bfe3813
commit 25b70e8c0d
5 changed files with 26 additions and 16 deletions

View File

@@ -50,9 +50,8 @@
/* Tiles not neighbouring */
if (::DistanceManhattan(t1, t2) != 1) return false;
if (t1 > t2) Swap(t1, t2);
DiagDirection to_other_tile = (TileX(t1) == TileX(t2)) ? DIAGDIR_SE : DIAGDIR_SW;
DiagDirection to_other_tile = ::DiagdirBetweenTiles(t1, t2);
/* Determine the reachable tracks from the shared edge */
TrackBits gtts2 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t2, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);