(svn r24152) -Fix [FS#5157]: [NoAI] Do not return the last 'cached' speed of vehicles when they are stopped/crashed
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user