summaryrefslogtreecommitdiff
path: root/ai/trolly/trolly.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-23 12:24:19 +0000
committertron <tron@openttd.org>2006-02-23 12:24:19 +0000
commit6a74cb27870168271f6b249badcefbeb1da3af8c (patch)
treef5ac06f102968f6cf3cbe40e0fca7d7a55514d1b /ai/trolly/trolly.c
parentc3c0afb902e5790a1b6c141d340e52d98f11316b (diff)
downloadopenttd-6a74cb27870168271f6b249badcefbeb1da3af8c.tar.xz
(svn r3660) Convert further road bits and type references to the functions/enums
Diffstat (limited to 'ai/trolly/trolly.c')
-rw-r--r--ai/trolly/trolly.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ai/trolly/trolly.c b/ai/trolly/trolly.c
index c46324cd0..30eda929e 100644
--- a/ai/trolly/trolly.c
+++ b/ai/trolly/trolly.c
@@ -21,6 +21,7 @@
#include "../../openttd.h"
#include "../../debug.h"
#include "../../functions.h"
+#include "../../road.h"
#include "../../table/strings.h"
#include "../../map.h"
#include "../../tile.h"
@@ -793,8 +794,7 @@ static void AiNew_State_FindDepot(Player *p)
tile = p->ainew.path_info.route[i];
for (j = 0; j < 4; j++) {
if (IsTileType(tile + TileOffsByDir(j), MP_STREET)) {
- // Its a street, test if it is a depot
- if (_m[tile + TileOffsByDir(j)].m5 & 0x20) {
+ if (GetRoadType(tile + TileOffsByDir(j)) == ROAD_DEPOT) {
// We found a depot, is it ours? (TELL ME!!!)
if (IsTileOwner(tile + TileOffsByDir(j), _current_player)) {
// Now, is it pointing to the right direction.........
@@ -1100,7 +1100,7 @@ static void AiNew_State_BuildDepot(Player *p)
int res = 0;
assert(p->ainew.state == AI_STATE_BUILD_DEPOT);
- if (IsTileType(p->ainew.depot_tile, MP_STREET) && _m[p->ainew.depot_tile].m5 & 0x20) {
+ if (IsTileType(p->ainew.depot_tile, MP_STREET) && GetRoadType(p->ainew.depot_tile) == ROAD_DEPOT) {
if (IsTileOwner(p->ainew.depot_tile, _current_player)) {
// The depot is already builded!
p->ainew.state = AI_STATE_BUILD_VEHICLE;