--- a/src/town_cmd.cpp Wed Jan 09 16:40:02 2008 +0000
+++ b/src/town_cmd.cpp Wed Jan 09 16:55:48 2008 +0000
@@ -502,7 +502,7 @@
static CommandCost ClearTile_Town(TileIndex tile, byte flags)
{
int rating;
- CommandCost cost;
+ CommandCost cost(EXPENSES_CONSTRUCTION);
Town *t;
HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
@@ -1496,8 +1496,6 @@
if (_game_mode != GM_EDITOR) return CMD_ERROR;
if (p2 > TSM_CITY) return CMD_ERROR;
- SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
/* Check if too close to the edge of map */
if (DistanceFromEdge(tile) < 12)
return_cmd_error(STR_0237_TOO_CLOSE_TO_EDGE_OF_MAP);
@@ -2097,7 +2095,6 @@
*/
CommandCost CmdDoTownAction(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- CommandCost cost;
Town *t;
if (!IsValidTownID(p1) || p2 > lengthof(_town_action_proc)) return CMD_ERROR;
@@ -2106,9 +2103,7 @@
if (!HasBit(GetMaskOfTownActions(NULL, _current_player, t), p2)) return CMD_ERROR;
- SET_EXPENSES_TYPE(EXPENSES_OTHER);
-
- cost.AddCost((_price.build_industry >> 8) * _town_action_costs[p2]);
+ CommandCost cost(EXPENSES_OTHER, (_price.build_industry >> 8) * _town_action_costs[p2]);
if (flags & DC_EXEC) {
_town_action_proc[p2](t);
@@ -2364,7 +2359,7 @@
/* Here we differ from TTDP by checking TILE_NOT_SLOPED */
if (((hs->building_flags & TILE_NOT_SLOPED) == 0) && !IsSteepSlope(tileh_new) &&
- (GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new))) return _price.terraform;
+ (GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new))) return CommandCost(EXPENSES_CONSTRUCTION, _price.terraform);
}
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);