1
0
Fork 0

(svn r15307) -Fix: AIVehicle::GetCurrentSpeed() should also use km-ish/h instead of mph. (Documentation by Rubidium)

release/0.7
frosch 2009-02-01 16:21:18 +00:00
parent c28c4c1986
commit 317220c2e4
5 changed files with 14 additions and 5 deletions

View File

@ -60,10 +60,13 @@ public:
static char *GetName(BridgeID bridge_id); static char *GetName(BridgeID bridge_id);
/** /**
* Get the maximum speed of a bridge (in km/h). * Get the maximum speed of a bridge.
* @param bridge_id The bridge to get the maximum speed of. * @param bridge_id The bridge to get the maximum speed of.
* @pre IsValidBridge(bridge_id). * @pre IsValidBridge(bridge_id).
* @return The maximum speed the bridge has. * @return The maximum speed the bridge has.
* @note The speed is in OpenTTD's internal speed unit.
* This is mph / 1.6, which is roughly km/h.
* To get km/h multiply this number by 1.00584.
*/ */
static int32 GetMaxSpeed(BridgeID bridge_id); static int32 GetMaxSpeed(BridgeID bridge_id);

View File

@ -91,7 +91,9 @@ public:
* @param engine_id The engine to get the maximum speed of. * @param engine_id The engine to get the maximum speed of.
* @pre IsValidEngine(engine_id). * @pre IsValidEngine(engine_id).
* @return The maximum speed the engine has. * @return The maximum speed the engine has.
* @note The speed is in km/h. * @note The speed is in OpenTTD's internal speed unit.
* This is mph / 1.6, which is roughly km/h.
* To get km/h multiply this number by 1.00584.
*/ */
static int32 GetMaxSpeed(EngineID engine_id); static int32 GetMaxSpeed(EngineID engine_id);

View File

@ -240,7 +240,9 @@ public:
/** /**
* Get the maximum speed of the offered engine. * Get the maximum speed of the offered engine.
* @return The maximum speed the engine has. * @return The maximum speed the engine has.
* @note The speed is in km/h. * @note The speed is in OpenTTD's internal speed unit.
* This is mph / 1.6, which is roughly km/h.
* To get km/h multiply this number by 1.00584.
*/ */
int32 GetMaxSpeed(); int32 GetMaxSpeed();

View File

@ -278,7 +278,7 @@
{ {
if (!IsValidVehicle(vehicle_id)) return -1; if (!IsValidVehicle(vehicle_id)) return -1;
return ::GetVehicle(vehicle_id)->GetDisplaySpeed(); return ::GetVehicle(vehicle_id)->GetDisplaySpeed() * 16 / 10;
} }
/* static */ AIVehicle::VehicleState AIVehicle::GetState(VehicleID vehicle_id) /* static */ AIVehicle::VehicleState AIVehicle::GetState(VehicleID vehicle_id)

View File

@ -205,7 +205,9 @@ public:
* @param vehicle_id The vehicle to get the age of. * @param vehicle_id The vehicle to get the age of.
* @pre IsValidVehicle(vehicle_id). * @pre IsValidVehicle(vehicle_id).
* @return The current speed of the vehicle. * @return The current speed of the vehicle.
* @note Speed is in km/h. * @note The speed is in OpenTTD's internal speed unit.
* This is mph / 1.6, which is roughly km/h.
* To get km/h multiply this number by 1.00584.
*/ */
static int32 GetCurrentSpeed(VehicleID vehicle_id); static int32 GetCurrentSpeed(VehicleID vehicle_id);