diff options
author | terkhen <terkhen@openttd.org> | 2010-03-06 13:04:25 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-03-06 13:04:25 +0000 |
commit | ef5764f98a665f554d168c10ac4f5b147d7e0dc3 (patch) | |
tree | f55c7a6440e27fdb87f4a6b49c32181a8d25a249 /src/ai/api/ai_engine.cpp | |
parent | 3ed1442e055fdc5217378fba14d8003009b048a2 (diff) | |
download | openttd-ef5764f98a665f554d168c10ac4f5b147d7e0dc3.tar.xz |
(svn r19349) -Add: [NoAI] AIs can get the power, weight and tractive effort of a road vehicle.
Diffstat (limited to 'src/ai/api/ai_engine.cpp')
-rw-r--r-- | src/ai/api/ai_engine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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(); |