diff options
author | frosch <frosch@openttd.org> | 2009-11-24 13:12:34 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-11-24 13:12:34 +0000 |
commit | 912bce0b8cdeca9849dd257ca95566b009719d53 (patch) | |
tree | a2abd63725a9c6baffb22a8b3c39dc6b2f535dfb /src/ship_cmd.cpp | |
parent | b6b551533532d64f47e883d770b9633027ca7628 (diff) | |
download | openttd-912bce0b8cdeca9849dd257ca95566b009719d53.tar.xz |
(svn r18266) -Codechange: Add a function to compute prices from price base and cost factor and use it consistently for vehicle purchase, running cost, and refit cost.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index c482539ab..fc579fc48 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -159,7 +159,9 @@ static void CheckIfShipNeedsService(Vehicle *v) Money Ship::GetRunningCost() const { - return GetVehicleProperty(this, PROP_SHIP_RUNNING_COST_FACTOR, ShipVehInfo(this->engine_type)->running_cost) * _price[PR_RUNNING_SHIP]; + const Engine *e = Engine::Get(this->engine_type); + uint cost_factor = GetVehicleProperty(this, PROP_SHIP_RUNNING_COST_FACTOR, e->u.ship.running_cost); + return GetPrice(PR_RUNNING_SHIP, cost_factor); } void Ship::OnNewDay() |