summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_rail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_rail.cpp')
-rw-r--r--src/ai/api/ai_rail.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp
index ae349ccde..1db02e274 100644
--- a/src/ai/api/ai_rail.cpp
+++ b/src/ai/api/ai_rail.cpp
@@ -469,3 +469,10 @@ static bool IsValidSignalType(int signal_type)
default: return -1;
}
}
+
+/* static */ int32 AIRail::GetMaxSpeed(RailType railtype)
+{
+ if (!AIRail::IsRailTypeAvailable(railtype)) return -1;
+
+ return ::GetRailTypeInfo((::RailType)railtype)->max_speed;
+}