(svn r23096) -Codechange: remove useless divisions and multiplications by TILE_HEIGHT for the snow line code

This commit is contained in:
rubidium
2011-11-04 10:25:58 +00:00
parent cceccd58e5
commit a70fdbcf2f
11 changed files with 33 additions and 32 deletions

View File

@@ -979,7 +979,7 @@ static void SetupFarmFieldFence(TileIndex tile, int size, byte type, Axis direct
static void PlantFarmField(TileIndex tile, IndustryID industry)
{
if (_settings_game.game_creation.landscape == LT_ARCTIC) {
if (GetTilePixelZ(tile) + TILE_HEIGHT * 2 >= GetSnowLine()) return;
if (GetTileZ(tile) + 2 >= GetSnowLine()) return;
}
/* determine field size */
@@ -1165,7 +1165,7 @@ static CommandCost CheckNewIndustry_NULL(TileIndex tile)
static CommandCost CheckNewIndustry_Forest(TileIndex tile)
{
if (_settings_game.game_creation.landscape == LT_ARCTIC) {
if (GetTilePixelZ(tile) < HighestSnowLine() + TILE_HEIGHT * 2U) {
if (GetTileZ(tile) < HighestSnowLine() + 2U) {
return_cmd_error(STR_ERROR_FOREST_CAN_ONLY_BE_PLANTED);
}
}
@@ -1209,7 +1209,7 @@ static CommandCost CheckNewIndustry_OilRig(TileIndex tile)
static CommandCost CheckNewIndustry_Farm(TileIndex tile)
{
if (_settings_game.game_creation.landscape == LT_ARCTIC) {
if (GetTilePixelZ(tile) + TILE_HEIGHT * 2 >= HighestSnowLine()) {
if (GetTileZ(tile) + 2 >= HighestSnowLine()) {
return_cmd_error(STR_ERROR_SITE_UNSUITABLE);
}
}