summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-11-07 22:47:54 +0000
committerfrosch <frosch@openttd.org>2009-11-07 22:47:54 +0000
commitba1fc280e3b0c13baedc2ef54dabb2deec41c818 (patch)
treef8f51f5d18355d9205052bad2e90e068e9bfacb6 /src/industry_cmd.cpp
parent7984d90c40f4d55cad9f34d0acac27beb701a63a (diff)
downloadopenttd-ba1fc280e3b0c13baedc2ef54dabb2deec41c818.tar.xz
(svn r18005) -Codechange: Convert the Prices struct into an array and an enum.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 57d112f47..42b66ca12 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2423,7 +2423,7 @@ bool IndustrySpec::IsRawIndustry() const
Money IndustrySpec::GetConstructionCost() const
{
- return (_price.build_industry *
+ return (_price[PR_BUILD_INDUSTRY] *
(_settings_game.construction.raw_industry_construction == 1 && this->IsRawIndustry() ?
this->raw_industry_cost_multiplier :
this->cost_multiplier
@@ -2432,7 +2432,7 @@ Money IndustrySpec::GetConstructionCost() const
Money IndustrySpec::GetRemovalCost() const
{
- return (_price.remove_house * this->removal_cost_multiplier) >> 8;
+ return (_price[PR_CLEAR_HOUSE] * 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.terraform);
+ if ((res == 0) || (res == CALLBACK_FAILED)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_TERRAFORM]);
} else {
/* allow autoslope */
- return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
+ return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_TERRAFORM]);
}
}
}