summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-11-24 22:15:42 +0000
committerfrosch <frosch@openttd.org>2009-11-24 22:15:42 +0000
commit830231e2bda3a2a68d3e8cc466059d8b5fcadb63 (patch)
tree24750800d52789ced0c719b59afa832fbc5a91cc /src/newgrf.cpp
parent8da21d58a9e50d1e08a94bb7cba83fec040f741b (diff)
downloadopenttd-830231e2bda3a2a68d3e8cc466059d8b5fcadb63.tar.xz
(svn r18283) -Feature: [NewGRF] Add new price bases for removing industries, building/removing unmovables (new objects), building/removing rail-waypoints/buoys, interacting with town-authority, building foundations, funding primary industries (when not prospecting) and towns.
If a GRF does not set price multipliers for these new prices, but for the previously used ones, the old modifiers will be propagated to the new bases.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index f481235f4..54c26de72 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -6217,11 +6217,24 @@ static void FinalisePriceBaseMultipliers()
}
}
- /* Decide local/global scope of price base multipliers */
+ /* Apply fallback prices */
const GRFFile * const *end = _grf_files.End();
for (GRFFile **file = _grf_files.Begin(); file != end; file++) {
PriceMultipliers &price_base_multipliers = (*file)->price_base_multipliers;
for (Price p = PR_BEGIN; p < PR_END; p++) {
+ Price fallback_price = _price_base_specs[p].fallback_price;
+ if (fallback_price != INVALID_PRICE && (byte)price_base_multipliers[p] == 0x80) {
+ /* No price multiplier has been set.
+ * So copy the multiplier from the fallback price, maybe a multiplier was set there. */
+ price_base_multipliers[p] = price_base_multipliers[fallback_price];
+ }
+ }
+ }
+
+ /* Decide local/global scope of price base multipliers */
+ for (GRFFile **file = _grf_files.Begin(); file != end; file++) {
+ PriceMultipliers &price_base_multipliers = (*file)->price_base_multipliers;
+ for (Price p = PR_BEGIN; p < PR_END; p++) {
if ((byte)price_base_multipliers[p] == 0x80) {
/* No multiplier was set; set it to a neutral value */
price_base_multipliers[p] = 0;