summaryrefslogtreecommitdiff
path: root/src/road_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/road_map.h')
-rw-r--r--src/road_map.h32
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);
}
/**