summaryrefslogtreecommitdiff
path: root/ai
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-11 09:10:46 +0000
committertron <tron@openttd.org>2006-03-11 09:10:46 +0000
commit25606a2e0b4f8dccb8c86c61d9859ba33b03fed9 (patch)
tree5a49ef225f58c5e3ddaaa72935a0c65e716fe884 /ai
parent0e4ee1241f6bf3e494176253857cb5dd5aae5c49 (diff)
downloadopenttd-25606a2e0b4f8dccb8c86c61d9859ba33b03fed9.tar.xz
(svn r3816) Use existing accessors
Diffstat (limited to 'ai')
-rw-r--r--ai/default/default.c2
-rw-r--r--ai/trolly/pathfinder.c3
-rw-r--r--ai/trolly/trolly.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/ai/default/default.c b/ai/default/default.c
index a92e8d1c2..f6e6cdbde 100644
--- a/ai/default/default.c
+++ b/ai/default/default.c
@@ -3659,7 +3659,7 @@ pos_3:
return;
}
- dir = _m[tile].m5 & 3;
+ dir = GetRoadDepotDirection(tile);
DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
DoCommandByTile(
diff --git a/ai/trolly/pathfinder.c b/ai/trolly/pathfinder.c
index d5244a1da..17fc15b66 100644
--- a/ai/trolly/pathfinder.c
+++ b/ai/trolly/pathfinder.c
@@ -9,6 +9,7 @@
#include "../../command.h"
#include "trolly.h"
#include "../../depot.h"
+#include "../../tunnel_map.h"
#include "../../variables.h"
#include "../ai.h"
@@ -236,7 +237,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// This problem only is valid for tunnels:
// When the last tile was not yet a tunnel, check if we enter from the right side..
if ((_m[atile].m5 & 0x80) == 0) {
- if (i != (_m[atile].m5 & 3U)) continue;
+ if (GetTunnelDirection(atile) != i) continue;
}
}
}
diff --git a/ai/trolly/trolly.c b/ai/trolly/trolly.c
index 2ccee6fb1..57cac9698 100644
--- a/ai/trolly/trolly.c
+++ b/ai/trolly/trolly.c
@@ -798,7 +798,7 @@ static void AiNew_State_FindDepot(Player *p)
if (IsTileType(t, MP_STREET) &&
GetRoadType(t) == ROAD_DEPOT &&
IsTileOwner(t, _current_player) &&
- GB(_m[t].m5, 0, 2) == ReverseDiagDir(j)) { // right direction?
+ GetRoadDepotDirection(t) == ReverseDiagDir(j)) {
p->ainew.depot_tile = t;
p->ainew.depot_direction = ReverseDiagDir(j);
p->ainew.state = AI_STATE_VERIFY_ROUTE;