mirror of https://github.com/OpenTTD/OpenTTD
(svn r24152) -Fix [FS#5157]: [NoAI] Do not return the last 'cached' speed of vehicles when they are stopped/crashed
parent
eeb781b429
commit
8d56856791
|
@ -311,7 +311,8 @@
|
||||||
{
|
{
|
||||||
if (!IsValidVehicle(vehicle_id)) return -1;
|
if (!IsValidVehicle(vehicle_id)) return -1;
|
||||||
|
|
||||||
return ::Vehicle::Get(vehicle_id)->GetDisplaySpeed(); // km-ish/h
|
const ::Vehicle *v = ::Vehicle::Get(vehicle_id);
|
||||||
|
return (v->vehstatus & (::VS_STOPPED | ::VS_CRASHED)) == 0 ? v->GetDisplaySpeed() : 0; // km-ish/h
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ ScriptVehicle::VehicleState ScriptVehicle::GetState(VehicleID vehicle_id)
|
/* static */ ScriptVehicle::VehicleState ScriptVehicle::GetState(VehicleID vehicle_id)
|
||||||
|
|
Loading…
Reference in New Issue