Mercurial > hg > openttd
diff src/road_map.h @ 8744:bcc06c9be6ef draft
(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
author | skidd13 <skidd13@openttd.org> |
---|---|
date | Thu, 27 Mar 2008 14:26:31 +0000 |
parents | c370e9d5f5c4 |
children | d48433370037 |
line wrap: on
line diff
--- a/src/road_map.h +++ b/src/road_map.h @@ -66,6 +66,20 @@ } /** + * 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