From b26d54585f5867a91b7119df83509398fc650f02 Mon Sep 17 00:00:00 2001 From: tron Date: Thu, 23 Feb 2006 12:24:19 +0000 Subject: (svn r3660) Convert further road bits and type references to the functions/enums --- ai/trolly/trolly.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ai/trolly') 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; -- cgit v1.2.3-70-g09d2