(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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user