diff options
author | skidd13 <skidd13@openttd.org> | 2008-03-27 14:26:31 +0000 |
---|---|---|
committer | skidd13 <skidd13@openttd.org> | 2008-03-27 14:26:31 +0000 |
commit | 75072624d861f01d7f7b9ff2c47363db6809f533 (patch) | |
tree | 158f91577f43b4a1b59e45b89581c542857205b7 /src/road_map.h | |
parent | 5ab921feaad31d0d1b0a2bf0d21b5612396a139d (diff) | |
download | openttd-75072624d861f01d7f7b9ff2c47363db6809f533.tar.xz |
(svn r12440) -Fix [FS#1694]: Make the road building and road removing conditions more union
-Feature: Allow to build/remove more road-piece combinations directly
Diffstat (limited to 'src/road_map.h')
-rw-r--r-- | src/road_map.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/road_map.h b/src/road_map.h index c4bb97712..c7423380a 100644 --- a/src/road_map.h +++ b/src/road_map.h @@ -66,6 +66,20 @@ static inline RoadBits GetRoadBits(TileIndex t, RoadType rt) } /** + * Get all RoadBits set on a tile except from the given RoadType + * + * @param t The tile from which we want to get the RoadBits + * @param rt The RoadType which we exclude from the querry + * @return all set RoadBits of the tile which are not from the given RoadType + */ +static inline RoadBits GetOtherRoadBits(TileIndex t, RoadType rt) +{ + return ((rt == ROADTYPE_ROAD) ? ROAD_NONE : GetRoadBits(t, ROADTYPE_ROAD)) | + ((rt == ROADTYPE_TRAM) ? ROAD_NONE : GetRoadBits(t, ROADTYPE_TRAM)) | + ((rt == ROADTYPE_HWAY) ? ROAD_NONE : GetRoadBits(t, ROADTYPE_HWAY)); +} + +/** * Get all set RoadBits on the given tile * * @param tile The tile from which we want to get the RoadBits |