summaryrefslogtreecommitdiff
path: root/src/road_map.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-05-24 19:36:20 +0000
committerfrosch <frosch@openttd.org>2008-05-24 19:36:20 +0000
commit6e7a7412cdb824dd53ca8470dcfbba1d07f891b8 (patch)
treec397ff33001e474f450c64ea28b740db9fd01e81 /src/road_map.h
parentc34b458ace0695fd89116dc29de4e1bec5fca89b (diff)
downloadopenttd-6e7a7412cdb824dd53ca8470dcfbba1d07f891b8.tar.xz
(svn r13233) -Fix: Replace some (incorrect) evaluations of TileOwner by RoadOwner.
-Fix: Before evaluating RoadOwner, check if the roadtype is present. -Fix: Some places assumed that MP_ROAD means normal street.
Diffstat (limited to 'src/road_map.h')
-rw-r--r--src/road_map.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/road_map.h b/src/road_map.h
index 305a1ab25..756e3fcb7 100644
--- a/src/road_map.h
+++ b/src/road_map.h
@@ -187,6 +187,12 @@ static inline void SetRoadOwner(TileIndex t, RoadType rt, Owner o)
}
}
+static inline bool IsRoadOwner(TileIndex t, RoadType rt, Owner o)
+{
+ assert(HasTileRoadType(t, rt));
+ return (GetRoadOwner(t, rt) == o);
+}
+
/** Which directions are disallowed ? */
enum DisallowedRoadDirections {
DRD_NONE, ///< None of the directions are disallowed