summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-01-22 21:33:08 +0000
committerglx <glx@openttd.org>2009-01-22 21:33:08 +0000
commitc5f0fe7c4074fc61dd54b756d2835fcf90ceaf05 (patch)
tree593969317bbdfd30857464beb43cbc118db5897d /src/roadveh_cmd.cpp
parentb2d0e14848816c8004055824f192abdaedcc0fbf (diff)
downloadopenttd-c5f0fe7c4074fc61dd54b756d2835fcf90ceaf05.tar.xz
(svn r15210) -Fix: Vehicle::GetRunningCost() was wrong for ships and aircraft
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp3
1 files changed, 1 insertions, 2 deletions
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;