diff options
author | frosch <frosch@openttd.org> | 2009-11-24 13:15:58 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-11-24 13:15:58 +0000 |
commit | d507136e04432c420bbf48bb322c22335bc0dbfa (patch) | |
tree | 0d3f50287b352572dfd8a735a6f87a83568a4baa /src/economy.cpp | |
parent | 5e247b6e439f8e717991d1bc5df27ddb732b1865 (diff) | |
download | openttd-d507136e04432c420bbf48bb322c22335bc0dbfa.tar.xz |
(svn r18268) -Feature: [NewGRF] Make price base multipliers related to vehicles only apply to the GRF locally, if it defines engines of that type itself.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index b8f4f6197..094c836a8 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -109,7 +109,7 @@ int _score_part[MAX_COMPANIES][SCORE_END]; Economy _economy; Prices _price; Money _additional_cash_required; -static int8 _price_base_multiplier[PR_END]; +static PriceMultipliers _price_base_multiplier; Money CalculateCompanyValue(const Company *c) { @@ -791,14 +791,16 @@ void InitializeEconomy() * Determine a certain price * @param index Price base * @param cost_factor Price factor + * @param grf_file NewGRF to use local price multipliers from. * @param shift Extra bit shifting after the computation * @return Price */ -Money GetPrice(Price index, uint cost_factor, int shift) +Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift) { if (index >= PR_END) return 0; Money cost = _price[index] * cost_factor; + if (grf_file != NULL) shift += grf_file->price_base_multipliers[index]; if (shift >= 0) { cost <<= shift; |