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
commit8f104a2e971822e548d210bcd83f84057e54702d (patch)
treec397ff33001e474f450c64ea28b740db9fd01e81 /src/road_map.h
parentca244cbd06c071ee625f47ddf80d055bfcab072f (diff)
downloadopenttd-8f104a2e971822e548d210bcd83f84057e54702d.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