diff options
author | peter1138 <peter1138@openttd.org> | 2008-02-21 19:09:10 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-02-21 19:09:10 +0000 |
commit | dda6cab17a451da637b15ecdbfd6f8f64be9ab77 (patch) | |
tree | ea01512db1a1157040bbc860c2b76afcf0fe4eee /src/roadveh_cmd.cpp | |
parent | c0544563a608dcb2275c344a131bc0669694c550 (diff) | |
download | openttd-dda6cab17a451da637b15ecdbfd6f8f64be9ab77.tar.xz |
(svn r12209) -Fix: [NewGRF] Support using any base price for rail and road vehicles' running cost, and show running cost of wagons if they have it.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 9ec9dfb60..0a9733209 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -2093,7 +2093,8 @@ void RoadVehicle::OnNewDay() if (this->running_ticks == 0) return; - CommandCost cost(EXPENSES_ROADVEH_RUN, RoadVehInfo(this->engine_type)->running_cost * _price.roadveh_running * this->running_ticks / (364 * DAY_TICKS)); + const RoadVehicleInfo *rvi = RoadVehInfo(this->engine_type); + CommandCost cost(EXPENSES_ROADVEH_RUN, rvi->running_cost * GetPriceByIndex(rvi->running_cost_class) * this->running_ticks / (364 * DAY_TICKS)); this->profit_this_year -= cost.GetCost(); this->running_ticks = 0; |