(svn r23504) -Feature: Aircraft range.
This commit is contained in:
@@ -448,6 +448,20 @@ Date Engine::GetLifeLengthInDays() const
|
||||
return (this->info.lifelength + _settings_game.vehicle.extend_vehicle_life) * DAYS_IN_LEAP_YEAR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the range of an aircraft type.
|
||||
* @return Range of the aircraft type in tiles or 0 if unlimited range.
|
||||
*/
|
||||
uint16 Engine::GetRange() const
|
||||
{
|
||||
switch (this->type) {
|
||||
case VEH_AIRCRAFT:
|
||||
return GetEngineProperty(this->index, PROP_AIRCRAFT_RANGE, this->u.air.max_range);
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the EngineOverrideManager with the default engines.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user