diff options
author | Erich Eckner <git@eckner.net> | 2018-10-30 11:13:12 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-30 15:28:03 +0100 |
commit | a34d095259409cf1454d9777deabbc00bcdb9407 (patch) | |
tree | 9e7c37ed33f5bd6b3c2f41cf248dcb656b2a4afa /src/road_map.h | |
parent | 6647cb917963c4e0d6d633b7a92af78167050893 (diff) | |
download | openttd-underground-plus-others-original.tar.xz |
underground patch appliedunderground-plus-others-original
Diffstat (limited to 'src/road_map.h')
-rw-r--r-- | src/road_map.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/road_map.h b/src/road_map.h index 6fe1a02b1..f79192f1e 100644 --- a/src/road_map.h +++ b/src/road_map.h @@ -251,6 +251,29 @@ static inline bool HasTownOwnedRoad(TileIndex t) return HasTileRoadType(t, ROADTYPE_ROAD) && IsRoadOwner(t, ROADTYPE_ROAD, OWNER_TOWN); } +static inline void MakeTrafficLights(TileIndex t) +{ + assert(IsTileType(t, MP_ROAD)); + assert(GetRoadTileType(t) == ROAD_TILE_NORMAL); + SetBit(_me[t].m7, 4); +} + +static inline void ClearTrafficLights(TileIndex t) +{ + assert(IsTileType(t, MP_ROAD)); + assert(GetRoadTileType(t) == ROAD_TILE_NORMAL); + ClrBit(_me[t].m7, 4); +} + +/** + * Check if a tile has traffic lights returns true if tile has traffic lights. + * @param t The tile to check. + */ +static inline bool HasTrafficLights(TileIndex t) +{ + return (IsTileType(t, MP_ROAD) && (GetRoadTileType(t) == ROAD_TILE_NORMAL) && HasBit(_me[t].m7, 4)); +} + /** Which directions are disallowed ? */ enum DisallowedRoadDirections { DRD_NONE, ///< None of the directions are disallowed @@ -493,7 +516,14 @@ static inline bool IncreaseRoadWorksCounter(TileIndex t) { AB(_me[t].m7, 0, 4, 1); - return GB(_me[t].m7, 0, 4) == 15; +// return GB(_me[t].m7, 0, 4) == 15; +//DC-1 - kevesebb idot az utjavitasra + return GB(_me[t].m7, 0, 4) == 1; +} + +static inline byte GetRoadWorksCounter(TileIndex t) +{ + return GB(_m[t].m3, 0, 4); } /** |