VST3PluginInstance::VST3Parameter::isDiscrete() always returns true

Hi!

I just found an issue that the function VST3PluginInstance::VST3Parameter::isDiscrete() always returns true.
It seems that the problem is the initialization order in line 2185ff in juce_VST3PluginFormat.cpp:

    const bool discrete = getNumSteps() != AudioProcessor::getDefaultNumParameterSteps();
    const int numSteps = [&]
    {
        auto stepCount = getParameterInfo().stepCount;
        return stepCount == 0 ? AudioProcessor::getDefaultNumParameterSteps()
                              : stepCount + 1;
    }();

The initialization of “discrete” calls getNumSteps(). That function returns “numSteps” which is still uninitialized in that moment.
Changing the order of these two initializations seems to fix the problem.

This was introduced with commit 9f03bbc358d67a3e0d0e3d7082259a4155aebd85 on March, 18 2021.

Thanks for reporting this, it’s fixed here: