mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r19349) -Add: [NoAI] AIs can get the power, weight and tractive effort of a road vehicle.
This commit is contained in:
parent
3ed1442e05
commit
ef5764f98a
@ -3220,9 +3220,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4921
|
||||
GetMaxAge(): 4392
|
||||
GetRunningCost(): 426
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 90
|
||||
GetWeight(): 10
|
||||
GetMaxTractiveEffort(): 29
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3346,9 +3346,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4429
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3400,9 +3400,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4716
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3508,9 +3508,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4511
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3562,9 +3562,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4306
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3616,9 +3616,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4388
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3670,9 +3670,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4675
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3724,9 +3724,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4839
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3778,9 +3778,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4962
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3832,9 +3832,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 4593
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
@ -3886,9 +3886,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
|
||||
GetPrice(): 5947
|
||||
GetMaxAge(): 5490
|
||||
GetRunningCost(): 421
|
||||
GetPower(): -1
|
||||
GetWeight(): -1
|
||||
GetMaxTractiveEffort(): -1
|
||||
GetPower(): 120
|
||||
GetWeight(): 9
|
||||
GetMaxTractiveEffort(): 26
|
||||
GetVehicleType(): 1
|
||||
GetRailType(): 255
|
||||
GetRoadType(): 0
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user