diff options
author | frosch <frosch@openttd.org> | 2010-07-10 10:54:30 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-07-10 10:54:30 +0000 |
commit | 969c059feae435ff5cabb2f33d10d939b318ec02 (patch) | |
tree | d5daa0d05cd4f59342be87002abe60b1bd2826d0 /src/ai/api/ai_rail.cpp | |
parent | 1055c2b0fd8feb8a4a3eb039c3170d7ee8160b46 (diff) | |
download | openttd-969c059feae435ff5cabb2f33d10d939b318ec02.tar.xz |
(svn r20107) -Add: [NoAI] AIIndustryType::INDUSTRYTYPE_TOWN and AIIndustryType::INDUSTRYTYPE_UNKNOWN for AIRail::BuildNewGRFRailStation(). Note that BuildNewGRFRailStation() now checks the passed industry type for validity.
Diffstat (limited to 'src/ai/api/ai_rail.cpp')
-rw-r--r-- | src/ai/api/ai_rail.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp index 36f060a50..51c9b04cf 100644 --- a/src/ai/api/ai_rail.cpp +++ b/src/ai/api/ai_rail.cpp @@ -12,6 +12,7 @@ #include "ai_rail.hpp" #include "ai_map.hpp" #include "ai_station.hpp" +#include "ai_industrytype.hpp" #include "../../command_type.h" #include "../../debug.h" #include "../../station_base.h" @@ -158,6 +159,8 @@ EnforcePrecondition(false, platform_length > 0 && platform_length <= 0xFF); EnforcePrecondition(false, IsRailTypeAvailable(GetCurrentRailType())); EnforcePrecondition(false, station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id)); + EnforcePrecondition(false, source_industry == AIIndustryType::INDUSTRYTYPE_UNKNOWN || source_industry == AIIndustryType::INDUSTRYTYPE_TOWN || AIIndustryType::IsValidIndustryType(source_industry)); + EnforcePrecondition(false, goal_industry == AIIndustryType::INDUSTRYTYPE_UNKNOWN || goal_industry == AIIndustryType::INDUSTRYTYPE_TOWN || AIIndustryType::IsValidIndustryType(goal_industry)); uint32 p1 = GetCurrentRailType() | (platform_length << 16) | (num_platforms << 8); if (direction == RAILTRACK_NW_SE) p1 |= 1 << 4; |