(svn r23504) -Feature: Aircraft range.

This commit is contained in:
michi_cc
2011-12-13 00:43:35 +00:00
parent 948f77eac3
commit 957b643ae6
17 changed files with 176 additions and 18 deletions

View File

@@ -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.
*/