diff options
author | frosch <frosch@openttd.org> | 2009-11-24 22:15:42 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-11-24 22:15:42 +0000 |
commit | 830231e2bda3a2a68d3e8cc466059d8b5fcadb63 (patch) | |
tree | 24750800d52789ced0c719b59afa832fbc5a91cc /src/industry_cmd.cpp | |
parent | 8da21d58a9e50d1e08a94bb7cba83fec040f741b (diff) | |
download | openttd-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/industry_cmd.cpp')
-rw-r--r-- | src/industry_cmd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index e76d324ef..f148a789e 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -2425,14 +2425,14 @@ bool IndustrySpec::IsRawIndustry() const Money IndustrySpec::GetConstructionCost() const { - /* Building raw industries like secondary is more expensive */ - return (_price[PR_BUILD_INDUSTRY] * this->cost_multiplier) >> - ((_settings_game.construction.raw_industry_construction == 1 && this->IsRawIndustry()) ? 5 : 8); + /* Building raw industries like secondary uses different price base */ + return (_price[(_settings_game.construction.raw_industry_construction == 1 && this->IsRawIndustry()) ? + PR_BUILD_INDUSTRY_RAW : PR_BUILD_INDUSTRY] * this->cost_multiplier) >> 8; } Money IndustrySpec::GetRemovalCost() const { - return (_price[PR_CLEAR_HOUSE] * this->removal_cost_multiplier) >> 8; + return (_price[PR_CLEAR_INDUSTRY] * this->removal_cost_multiplier) >> 8; } static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new) @@ -2454,10 +2454,10 @@ static CommandCost TerraformTile_Industry(TileIndex tile, DoCommandFlag flags, u if (HasBit(itspec->callback_mask, CBM_INDT_AUTOSLOPE)) { /* If the callback fails, allow autoslope. */ uint16 res = GetIndustryTileCallback(CBID_INDUSTRY_AUTOSLOPE, 0, 0, gfx, Industry::GetByTile(tile), tile); - if ((res == 0) || (res == CALLBACK_FAILED)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_TERRAFORM]); + if ((res == 0) || (res == CALLBACK_FAILED)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } else { /* allow autoslope */ - return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_TERRAFORM]); + return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } } } |