(svn r19591) -Add: [NoAI] AIRail::GetMaxSpeed(RailType) to get the speed limit of railtypes

This commit is contained in:
yexo
2010-04-09 12:02:50 +00:00
parent 737b003c8a
commit a7e31778b3
5 changed files with 22 additions and 0 deletions

View File

@@ -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;
}