summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_changelog.hpp3
-rw-r--r--src/ai/api/ai_engine.cpp6
-rw-r--r--src/ai/api/ai_engine.hpp6
3 files changed, 9 insertions, 6 deletions
diff --git a/src/ai/api/ai_changelog.hpp b/src/ai/api/ai_changelog.hpp
index 4c0f7f876..3256509bf 100644
--- a/src/ai/api/ai_changelog.hpp
+++ b/src/ai/api/ai_changelog.hpp
@@ -27,6 +27,9 @@
* Other changes:
* \li AIRoad::BuildRoadStation now allows overbuilding
* \li AIRoad::BuildDriveThroughRoadStation now allows overbuilding
+ * \li AIEngine::GetPower can be used for road vehicles.
+ * \li AIEngine::GetWeight can be used for road vehicles.
+ * \li AIEngine::GetMaxTractiveEffort can be used for road vehicles.
*
* \b 1.0.0
*
diff --git a/src/ai/api/ai_engine.cpp b/src/ai/api/ai_engine.cpp
index 3793b748c..d24a8b6e0 100644
--- a/src/ai/api/ai_engine.cpp
+++ b/src/ai/api/ai_engine.cpp
@@ -148,7 +148,7 @@
/* static */ int32 AIEngine::GetPower(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
- if (GetVehicleType(engine_id) != AIVehicle::VT_RAIL) return -1;
+ if (GetVehicleType(engine_id) != AIVehicle::VT_RAIL && GetVehicleType(engine_id) != AIVehicle::VT_ROAD) return -1;
if (IsWagon(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetPower();
@@ -157,7 +157,7 @@
/* static */ int32 AIEngine::GetWeight(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
- if (GetVehicleType(engine_id) != AIVehicle::VT_RAIL) return -1;
+ if (GetVehicleType(engine_id) != AIVehicle::VT_RAIL && GetVehicleType(engine_id) != AIVehicle::VT_ROAD) return -1;
return ::Engine::Get(engine_id)->GetDisplayWeight();
}
@@ -165,7 +165,7 @@
/* static */ int32 AIEngine::GetMaxTractiveEffort(EngineID engine_id)
{
if (!IsValidEngine(engine_id)) return -1;
- if (GetVehicleType(engine_id) != AIVehicle::VT_RAIL) return -1;
+ if (GetVehicleType(engine_id) != AIVehicle::VT_RAIL && GetVehicleType(engine_id) != AIVehicle::VT_ROAD) return -1;
if (IsWagon(engine_id)) return -1;
return ::Engine::Get(engine_id)->GetDisplayMaxTractiveEffort();
diff --git a/src/ai/api/ai_engine.hpp b/src/ai/api/ai_engine.hpp
index 431f622c8..62cfcbc4d 100644
--- a/src/ai/api/ai_engine.hpp
+++ b/src/ai/api/ai_engine.hpp
@@ -146,7 +146,7 @@ public:
* Get the power of an engine.
* @param engine_id The engine to get the power of.
* @pre IsValidEngine(engine_id).
- * @pre GetVehicleType(engine_id) == AIVehicle::VT_RAIL && !IsWagon(engine_id).
+ * @pre (GetVehicleType(engine_id) == AIVehicle::VT_RAIL || GetVehicleType(engine_id) == AIVehicle::VT_ROAD) && !IsWagon(engine_id).
* @return The power of the engine in hp.
*/
static int32 GetPower(EngineID engine_id);
@@ -155,7 +155,7 @@ public:
* Get the weight of an engine.
* @param engine_id The engine to get the weight of.
* @pre IsValidEngine(engine_id).
- * @pre GetVehicleType(engine_id) == AIVehicle::VT_RAIL.
+ * @pre (GetVehicleType(engine_id) == AIVehicle::VT_RAIL || GetVehicleType(engine_id) == AIVehicle::VT_ROAD).
* @return The weight of the engine in metric tons.
*/
static int32 GetWeight(EngineID engine_id);
@@ -164,7 +164,7 @@ public:
* Get the maximum tractive effort of an engine.
* @param engine_id The engine to get the maximum tractive effort of.
* @pre IsValidEngine(engine_id).
- * @pre GetVehicleType(engine_id) == AIVehicle::VT_RAIL && !IsWagon(engine_id).
+ * @pre (GetVehicleType(engine_id) == AIVehicle::VT_RAIL || GetVehicleType(engine_id) == AIVehicle::VT_ROAD) && !IsWagon(engine_id).
* @return The maximum tractive effort of the engine in kN.
*/
static int32 GetMaxTractiveEffort(EngineID engine_id);