From c5f0fe7c4074fc61dd54b756d2835fcf90ceaf05 Mon Sep 17 00:00:00 2001 From: glx Date: Thu, 22 Jan 2009 21:33:08 +0000 Subject: (svn r15210) -Fix: Vehicle::GetRunningCost() was wrong for ships and aircraft --- src/roadveh_cmd.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/roadveh_cmd.cpp') diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 10a85cc04..914f8e2d8 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1999,8 +1999,7 @@ void RoadVehicle::OnNewDay() if (this->running_ticks == 0) return; - const RoadVehicleInfo *rvi = RoadVehInfo(this->engine_type); - CommandCost cost(EXPENSES_ROADVEH_RUN, rvi->running_cost * GetPriceByIndex(rvi->running_cost_class) * this->running_ticks / (DAYS_IN_YEAR * DAY_TICKS)); + CommandCost cost(EXPENSES_ROADVEH_RUN, this->GetRunningCost() * this->running_ticks / (DAYS_IN_YEAR * DAY_TICKS)); this->profit_this_year -= cost.GetCost(); this->running_ticks = 0; -- cgit v1.2.3-70-g09d2