summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-06-05 01:43:03 +0000
committerbelugas <belugas@openttd.org>2008-06-05 01:43:03 +0000
commit4f3eb7f3cda1927822699943574f1c2918548dde (patch)
tree03a05f0530f270ebbdf8d658eba39aececdf68ac /src/town_cmd.cpp
parentdc22170c99aed1aeb04132767fddf5f7f165418c (diff)
downloadopenttd-4f3eb7f3cda1927822699943574f1c2918548dde.tar.xz
(svn r13383) -Codechange: Put the cost of house removal in a class member
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 5314803ec..97c111461 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -127,6 +127,11 @@ void Town::InitializeLayout()
}
}
+Money HouseSpec::GetRemovalCost() const
+{
+ return (_price.remove_house * this->removal_cost) >> 8;
+}
+
// Local
static int _grow_town_result;
@@ -517,7 +522,7 @@ static CommandCost ClearTile_Town(TileIndex tile, byte flags)
const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
CommandCost cost(EXPENSES_CONSTRUCTION);
- cost.AddCost(_price.remove_house * hs->removal_cost >> 8);
+ cost.AddCost(hs->GetRemovalCost());
int rating = hs->remove_rating_decrease;
_cleared_town_rating += rating;