summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-23 08:20:28 +0000
committertron <tron@openttd.org>2006-02-23 08:20:28 +0000
commitdf156dacb21b1a1ae09bf498340358cbe5de33fa (patch)
tree902fe3272275a4a3b554d21b247e7f5811687ebe /roadveh_cmd.c
parentb79872366debb336f43621f4d00d72d3fa3ac889 (diff)
downloadopenttd-df156dacb21b1a1ae09bf498340358cbe5de33fa.tar.xz
(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 130bed239..c1ffc1281 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -4,6 +4,7 @@
#include "openttd.h"
#include "debug.h"
#include "functions.h"
+#include "road.h"
#include "table/strings.h"
#include "map.h"
#include "tile.h"
@@ -288,7 +289,7 @@ static bool EnumRoadSignalFindDepot(TileIndex tile, RoadFindDepotData *rfdd, int
tile += TileOffsByDir(_road_pf_directions[track]);
if (IsTileType(tile, MP_STREET) &&
- GB(_m[tile].m5, 4, 4) == 2 &&
+ GetRoadType(tile) == ROAD_DEPOT &&
IsTileOwner(tile, rfdd->owner)) {
if (length < rfdd->best_length) {
@@ -978,7 +979,7 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir)
}
if (IsTileType(tile, MP_STREET)) {
- if (GB(_m[tile].m5, 4, 4) == 2 && IsTileOwner(tile, v->owner)) {
+ if (GetRoadType(tile) == ROAD_DEPOT && IsTileOwner(tile, v->owner)) {
/* Road depot */
bitmask |= _road_veh_fp_ax_or[GB(_m[tile].m5, 0, 2)];
}
@@ -1052,9 +1053,7 @@ static int RoadFindPathToDest(Vehicle *v, TileIndex tile, int enterdir)
} else {
if (IsTileType(desttile, MP_STREET)) {
m5 = _m[desttile].m5;
- if ((m5 & 0xF0) == 0x20)
- /* We are heading for a Depot */
- goto do_it;
+ if (GetRoadType(desttile) == ROAD_DEPOT) goto do_it;
} else if (IsTileType(desttile, MP_STATION)) {
m5 = _m[desttile].m5;
if (IS_BYTE_INSIDE(m5, 0x43, 0x4B)) {