src/station_cmd.cpp
changeset 6459 8c66c58bf6cf
parent 6443 b8f06d8eb7be
child 6460 b3017e083031
equal deleted inserted replaced
6458:5cd016e1f018 6459:8c66c58bf6cf
  1745 		default: return_cmd_error(STR_304B_SITE_UNSUITABLE);
  1745 		default: return_cmd_error(STR_304B_SITE_UNSUITABLE);
  1746 	}
  1746 	}
  1747 
  1747 
  1748 	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
  1748 	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
  1749 
  1749 
  1750 	if (!EnsureNoVehicle(tile)) return CMD_ERROR;
       
  1751 
       
  1752 	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
  1750 	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
  1753 	if (CmdFailed(cost)) return CMD_ERROR;
  1751 	if (CmdFailed(cost)) return CMD_ERROR;
  1754 
  1752 
  1755 	TileIndex tile_cur = tile + TileOffsByDiagDir(direction);
  1753 	TileIndex tile_cur = tile + TileOffsByDiagDir(direction);
  1756 
       
  1757 	if (!EnsureNoVehicle(tile_cur)) return CMD_ERROR;
       
  1758 
  1754 
  1759 	if (!IsTileType(tile_cur, MP_WATER) || GetTileSlope(tile_cur, NULL) != SLOPE_FLAT) {
  1755 	if (!IsTileType(tile_cur, MP_WATER) || GetTileSlope(tile_cur, NULL) != SLOPE_FLAT) {
  1760 		return_cmd_error(STR_304B_SITE_UNSUITABLE);
  1756 		return_cmd_error(STR_304B_SITE_UNSUITABLE);
  1761 	}
  1757 	}
  1762 
  1758