summaryrefslogtreecommitdiff
path: root/ai/default
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-12 16:13:16 +0000
committertron <tron@openttd.org>2006-03-12 16:13:16 +0000
commiteeb5bf41a152087031b0764d5d3b2783922b70ae (patch)
tree3d2526e7f2638131186fe93a08829d1bf29f22b5 /ai/default
parent0100871412ac1b48aa64a87f2d88d8276212963e (diff)
downloadopenttd-eeb5bf41a152087031b0764d5d3b2783922b70ae.tar.xz
(svn r3831) Add and use GetRailDepotDirection()
Diffstat (limited to 'ai/default')
-rw-r--r--ai/default/default.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ai/default/default.c b/ai/default/default.c
index 41580720c..7ba7fb137 100644
--- a/ai/default/default.c
+++ b/ai/default/default.c
@@ -4,6 +4,7 @@
#include "../../openttd.h"
#include "../../functions.h"
#include "../../map.h"
+#include "../../rail_map.h"
#include "../../road_map.h"
#include "../../tile.h"
#include "../../player.h"
@@ -3625,8 +3626,9 @@ pos_3:
} else {
static const byte _depot_bits[] = {0x19,0x16,0x25,0x2A};
- m5 &= 3;
- if (GetRailTrackStatus(tile + TileOffsByDir(m5)) & _depot_bits[m5])
+ DiagDirection dir = GetRailDepotDirection(tile);
+
+ if (GetRailTrackStatus(tile + TileOffsByDir(dir)) & _depot_bits[dir])
return;
DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);