1
0
Fork 0

(svn r24152) -Fix [FS#5157]: [NoAI] Do not return the last 'cached' speed of vehicles when they are stopped/crashed

release/1.3
rubidium 2012-04-18 19:21:54 +00:00
parent eeb781b429
commit 8d56856791
1 changed files with 2 additions and 1 deletions

View File

@ -311,7 +311,8 @@
{
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)