summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-07-02 16:34:11 +0000
committermichi_cc <michi_cc@openttd.org>2010-07-02 16:34:11 +0000
commit34f32cbbf47b2cb332b51342c429da93856281d7 (patch)
treecfeca95505173e09a25326035c3d643de143b587 /src/ai/api
parenta75583bbb6d600d51f76edc396279aa0fe6f4c32 (diff)
downloadopenttd-34f32cbbf47b2cb332b51342c429da93856281d7.tar.xz
(svn r20049) -Feature: [NewGRF] Add a railtype flag to disallow level crossings per railtype.
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_changelog.hpp1
-rw-r--r--src/ai/api/ai_rail.hpp3
-rw-r--r--src/ai/api/ai_rail.hpp.sq3
3 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/api/ai_changelog.hpp b/src/ai/api/ai_changelog.hpp
index c748066cd..e907ce007 100644
--- a/src/ai/api/ai_changelog.hpp
+++ b/src/ai/api/ai_changelog.hpp
@@ -22,6 +22,7 @@
* \li IsEnd for all lists.
* \li AIIndustry::GetIndustryID
* \li AIRail::GetMaxSpeed
+ * \li AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING
*
* API removals:
* \li HasNext for all lists.
diff --git a/src/ai/api/ai_rail.hpp b/src/ai/api/ai_rail.hpp
index 807248243..26d649aa4 100644
--- a/src/ai/api/ai_rail.hpp
+++ b/src/ai/api/ai_rail.hpp
@@ -38,6 +38,9 @@ public:
/** Non-uniform stations is diabled */
ERR_NONUNIFORM_STATIONS_DISABLED, // [STR_ERROR_NONUNIFORM_STATIONS_DISALLOWED]
+
+ /** This railtype cannot have crossings */
+ ERR_RAILTYPE_DISALLOWS_CROSSING, // [STR_ERROR_CROSSING_DISALLOWED]
};
/**
diff --git a/src/ai/api/ai_rail.hpp.sq b/src/ai/api/ai_rail.hpp.sq
index 30c875c4e..04ddfb1a0 100644
--- a/src/ai/api/ai_rail.hpp.sq
+++ b/src/ai/api/ai_rail.hpp.sq
@@ -42,6 +42,7 @@ void SQAIRail_Register(Squirrel *engine)
SQAIRail.DefSQConst(engine, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
SQAIRail.DefSQConst(engine, AIRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
SQAIRail.DefSQConst(engine, AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, "ERR_NONUNIFORM_STATIONS_DISABLED");
+ SQAIRail.DefSQConst(engine, AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
SQAIRail.DefSQConst(engine, AIRail::RAILTYPE_INVALID, "RAILTYPE_INVALID");
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NE_SW, "RAILTRACK_NE_SW");
SQAIRail.DefSQConst(engine, AIRail::RAILTRACK_NW_SE, "RAILTRACK_NW_SE");
@@ -71,10 +72,12 @@ void SQAIRail_Register(Squirrel *engine)
AIError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD, AIRail::ERR_CROSSING_ON_ONEWAY_ROAD);
AIError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, AIRail::ERR_UNSUITABLE_TRACK);
AIError::RegisterErrorMap(STR_ERROR_NONUNIFORM_STATIONS_DISALLOWED, AIRail::ERR_NONUNIFORM_STATIONS_DISABLED);
+ AIError::RegisterErrorMap(STR_ERROR_CROSSING_DISALLOWED, AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING);
AIError::RegisterErrorMapString(AIRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
AIError::RegisterErrorMapString(AIRail::ERR_UNSUITABLE_TRACK, "ERR_UNSUITABLE_TRACK");
AIError::RegisterErrorMapString(AIRail::ERR_NONUNIFORM_STATIONS_DISABLED, "ERR_NONUNIFORM_STATIONS_DISABLED");
+ AIError::RegisterErrorMapString(AIRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
SQAIRail.DefSQStaticMethod(engine, &AIRail::IsRailTile, "IsRailTile", 2, ".i");
SQAIRail.DefSQStaticMethod(engine, &AIRail::IsLevelCrossingTile, "IsLevelCrossingTile", 2, ".i");