(svn r24246) -Add [FS#5052-ish]: [NewGRF] Variable with the current max speed for vehicles.

This commit is contained in:
michi_cc
2012-05-14 19:56:49 +00:00
parent 58d474797e
commit ce5c936b07
5 changed files with 14 additions and 0 deletions

View File

@@ -619,6 +619,10 @@ static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte
case 0x4B: // Long date of last service
return v->date_of_last_service;
case 0x4C: // Current maximum speed in NewGRF units
if (!v->IsPrimaryVehicle()) return 0;
return v->GetCurrentMaxSpeed();
/* Variables which use the parameter */
case 0x60: // Count consist's engine ID occurance
if (v->type != VEH_TRAIN) return v->GetEngine()->grf_prop.local_id == parameter ? 1 : 0;