diff options
author | frosch <frosch@openttd.org> | 2011-11-01 00:21:08 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-01 00:21:08 +0000 |
commit | 72cd855978bf45fd444eae72551a12e13a35b0c8 (patch) | |
tree | b7f4b3cc07022ba32160f5e67f4cb5a527266d12 /src/aircraft_cmd.cpp | |
parent | c366e0d45f87f9ba625ed73cbf5bff61d8483c5c (diff) | |
download | openttd-72cd855978bf45fd444eae72551a12e13a35b0c8.tar.xz |
(svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code.
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 7475e412f..3996e739d 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -151,7 +151,7 @@ SpriteID Aircraft::GetImage(Direction direction) const SpriteID sprite = GetCustomVehicleSprite(this, direction); if (sprite != 0) return sprite; - spritenum = Engine::Get(this->engine_type)->original_image_index; + spritenum = this->GetEngine()->original_image_index; } return direction + _aircraft_sprite[spritenum]; @@ -389,7 +389,7 @@ static void CheckIfAircraftNeedsService(Aircraft *v) Money Aircraft::GetRunningCost() const { - const Engine *e = Engine::Get(this->engine_type); + const Engine *e = this->GetEngine(); uint cost_factor = GetVehicleProperty(this, PROP_AIRCRAFT_RUNNING_COST_FACTOR, e->u.air.running_cost); return GetPrice(PR_RUNNING_AIRCRAFT, cost_factor, e->grf_prop.grffile); } @@ -1364,7 +1364,7 @@ static void AircraftEventHandler_AtTerminal(Aircraft *v, const AirportFTAClass * /* an exerpt of ServiceAircraft, without the invisibility stuff */ v->date_of_last_service = _date; v->breakdowns_since_last_service = 0; - v->reliability = Engine::Get(v->engine_type)->reliability; + v->reliability = v->GetEngine()->reliability; SetWindowDirty(WC_VEHICLE_DETAILS, v->index); } } |