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/roadveh_cmd.cpp | |
parent | c366e0d45f87f9ba625ed73cbf5bff61d8483c5c (diff) | |
download | openttd-72cd855978bf45fd444eae72551a12e13a35b0c8.tar.xz |
(svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 15c2bf49a..a77fa38bb 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -127,7 +127,7 @@ SpriteID RoadVehicle::GetImage(Direction direction) const sprite = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(spritenum))); if (sprite != 0) return sprite; - spritenum = Engine::Get(this->engine_type)->original_image_index; + spritenum = this->GetEngine()->original_image_index; } sprite = direction + _roadveh_images[spritenum]; @@ -1527,7 +1527,7 @@ static bool RoadVehController(RoadVehicle *v) Money RoadVehicle::GetRunningCost() const { - const Engine *e = Engine::Get(this->engine_type); + const Engine *e = this->GetEngine(); if (e->u.road.running_cost_class == INVALID_PRICE) return 0; uint cost_factor = GetVehicleProperty(this, PROP_ROADVEH_RUNNING_COST_FACTOR, e->u.road.running_cost); |