summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-06-11 14:29:03 +0000
committeryexo <yexo@openttd.org>2009-06-11 14:29:03 +0000
commitb3c3cf6e6d5cecd4769b0ca09c3b60bb576656c1 (patch)
tree4d2dd282554d72c58e9391e9fb834659d2aed0fc
parentf92feb2a9516aedcd00961fc8649714249064e4f (diff)
downloadopenttd-b3c3cf6e6d5cecd4769b0ca09c3b60bb576656c1.tar.xz
(svn r16563) -Fix [NoAI]: AIMarine::AreWaterTilesConnected didn't return true for bridge head<>neighbouring water tile
-rw-r--r--src/ai/api/ai_marine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_marine.cpp b/src/ai/api/ai_marine.cpp
index fffa1e3a3..b59307671 100644
--- a/src/ai/api/ai_marine.cpp
+++ b/src/ai/api/ai_marine.cpp
@@ -54,13 +54,13 @@
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);
- if (gtts2 == TRACK_BIT_NONE) return false;
+ TrackBits gtts1 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t1, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);
+ if (gtts1 == TRACK_BIT_NONE) return false;
to_other_tile = ReverseDiagDir(to_other_tile);
- TrackBits gtts1 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t1, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);
+ TrackBits gtts2 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t2, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);
- return gtts1 != TRACK_BIT_NONE;
+ return gtts2 != TRACK_BIT_NONE;
}
/* static */ bool AIMarine::BuildWaterDepot(TileIndex tile, TileIndex front)