src/town_cmd.cpp
changeset 9463 174d00929d44
parent 9450 9e7d05b0b1e5
child 9470 08424e2e79e4
equal deleted inserted replaced
9462:8c8bcb29604d 9463:174d00929d44
   125 		case TL_RANDOM: this->layout = TL_ORIGINAL; break;
   125 		case TL_RANDOM: this->layout = TL_ORIGINAL; break;
   126 		case TL_NO_ROADS: this->layout = TL_BETTER_ROADS; break;
   126 		case TL_NO_ROADS: this->layout = TL_BETTER_ROADS; break;
   127 	}
   127 	}
   128 }
   128 }
   129 
   129 
       
   130 Money HouseSpec::GetRemovalCost() const
       
   131 {
       
   132 	return (_price.remove_house * this->removal_cost) >> 8;
       
   133 }
       
   134 
   130 // Local
   135 // Local
   131 static int _grow_town_result;
   136 static int _grow_town_result;
   132 
   137 
   133 /* Describe the possible states */
   138 /* Describe the possible states */
   134 enum TownGrowthResult {
   139 enum TownGrowthResult {
   515 	if (!CanDeleteHouse(tile)) return CMD_ERROR;
   520 	if (!CanDeleteHouse(tile)) return CMD_ERROR;
   516 
   521 
   517 	const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
   522 	const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
   518 
   523 
   519 	CommandCost cost(EXPENSES_CONSTRUCTION);
   524 	CommandCost cost(EXPENSES_CONSTRUCTION);
   520 	cost.AddCost(_price.remove_house * hs->removal_cost >> 8);
   525 	cost.AddCost(hs->GetRemovalCost());
   521 
   526 
   522 	int rating = hs->remove_rating_decrease;
   527 	int rating = hs->remove_rating_decrease;
   523 	_cleared_town_rating += rating;
   528 	_cleared_town_rating += rating;
   524 	Town *t = _cleared_town = GetTownByTile(tile);
   529 	Town *t = _cleared_town = GetTownByTile(tile);
   525 
   530