summaryrefslogtreecommitdiff
path: root/src/articulated_vehicles.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2012-03-14 20:49:54 +0000
committeryexo <yexo@openttd.org>2012-03-14 20:49:54 +0000
commit1f0593e7caadb5bc5861d613b43ead8f663608be (patch)
tree3195b437e9d7884bda3a553c926bcfa31fc01f9f /src/articulated_vehicles.cpp
parentc7ae0b4db62a088f074c3d3631bced839a84ef51 (diff)
downloadopenttd-1f0593e7caadb5bc5861d613b43ead8f663608be.tar.xz
(svn r24029) -Change: [NoAI] make AIEngine::IsArticulated return true if the articulated callback flag is set, don't try to run the callback.
Diffstat (limited to 'src/articulated_vehicles.cpp')
-rw-r--r--src/articulated_vehicles.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp
index d153a169f..a889ab3d8 100644
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -55,6 +55,16 @@ static EngineID GetNextArticulatedPart(uint index, EngineID front_type, Vehicle
}
/**
+ * Does a NewGRF report that this should be an articulated vehicle?
+ * @param engine_type The engine to check.
+ * @return True iff the articulated engine callback flag is set.
+ */
+bool IsArticulatedEngine(EngineID engine_type)
+{
+ return HasBit(EngInfo(engine_type)->callback_mask, CBM_VEHICLE_ARTIC_ENGINE);
+}
+
+/**
* Count the number of articulated parts of an engine.
* @param engine_type The engine to get the number of parts of.
* @param purchase_window Whether we are in the scope of the purchase window or not, i.e. whether we cannot allocate vehicles.