summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index bbe258e84..bc69349c3 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -1827,13 +1827,13 @@ static bool RoadVehController(RoadVehicle *v)
Money RoadVehicle::GetRunningCost() const
{
- const RoadVehicleInfo *rvi = RoadVehInfo(this->engine_type);
- if (rvi->running_cost_class == INVALID_PRICE) return 0;
+ const Engine *e = Engine::Get(this->engine_type);
+ if (e->u.road.running_cost_class == INVALID_PRICE) return 0;
- uint cost_factor = GetVehicleProperty(this, PROP_ROADVEH_RUNNING_COST_FACTOR, rvi->running_cost);
+ uint cost_factor = GetVehicleProperty(this, PROP_ROADVEH_RUNNING_COST_FACTOR, e->u.road.running_cost);
if (cost_factor == 0) return 0;
- return cost_factor * GetPriceByIndex(rvi->running_cost_class);
+ return GetPrice(e->u.road.running_cost_class, cost_factor);
}
bool RoadVehicle::Tick()