(svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user