summaryrefslogtreecommitdiff
path: root/src/town_cmd.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/town_cmd.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/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 3257ef54f..957cc2197 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1570,7 +1570,7 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* multidimensional arrays have to have defined length of non-first dimension */
assert_compile(lengthof(price_mult[0]) == 4);
- CommandCost cost(EXPENSES_OTHER, _price[PR_BUILD_INDUSTRY]);
+ CommandCost cost(EXPENSES_OTHER, _price[PR_BUILD_TOWN]);
byte mult = price_mult[city][size];
cost.MultiplyCost(mult);
@@ -2511,7 +2511,6 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t)
/* Things worth more than this are not shown */
Money avail = Company::Get(cid)->money + _price[PR_STATION_VALUE] * 200;
- Money ref = _price[PR_BUILD_INDUSTRY] >> 8;
/* Check the action bits for validity and
* if they are valid add them */
@@ -2530,7 +2529,7 @@ uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t)
if (cur == TACT_BUILD_STATUE && HasBit(t->statues, cid))
continue;
- if (avail >= _town_action_costs[i] * ref) {
+ if (avail >= _town_action_costs[i] * _price[PR_TOWN_ACTION] >> 8) {
buttons |= cur;
num++;
}
@@ -2558,7 +2557,7 @@ CommandCost CmdDoTownAction(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
if (!HasBit(GetMaskOfTownActions(NULL, _current_company, t), p2)) return CMD_ERROR;
- CommandCost cost(EXPENSES_OTHER, (_price[PR_BUILD_INDUSTRY] >> 8) * _town_action_costs[p2]);
+ CommandCost cost(EXPENSES_OTHER, _price[PR_TOWN_ACTION] * _town_action_costs[p2] >> 8);
if (flags & DC_EXEC) {
_town_action_proc[p2](t);
@@ -2894,7 +2893,7 @@ static CommandCost TerraformTile_Town(TileIndex tile, DoCommandFlag flags, uint
if ((res != 0) && (res != CALLBACK_FAILED)) allow_terraform = false;
}
- if (allow_terraform) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_TERRAFORM]);
+ if (allow_terraform) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]);
}
}