diff --git a/src/options.cpp b/src/options.cpp index 1f8b66784a535..6fe480165a5e8 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -147,14 +147,32 @@ void options_manager::add_external( const std::string &sNameIn, const std::strin thisOpt.sMenuText = sMenuTextIn; thisOpt.sTooltip = sTooltipIn; thisOpt.sType = sType; + thisOpt.verbose = false; thisOpt.eType = get_value_type( thisOpt.sType ); - thisOpt.iMin = INT_MIN; - thisOpt.iMax = INT_MAX; - - thisOpt.fMin = INT_MIN; - thisOpt.fMax = INT_MAX; + switch( thisOpt.eType ) { + case cOpt::CVT_BOOL: + thisOpt.bSet = false; + thisOpt.bDefault = false; + break; + case cOpt::CVT_INT: + thisOpt.iMin = INT_MIN; + thisOpt.iMax = INT_MAX; + thisOpt.iDefault = 0; + thisOpt.iSet = 0; + break; + case cOpt::CVT_FLOAT: + thisOpt.fMin = INT_MIN; + thisOpt.fMax = INT_MAX; + thisOpt.fDefault = 0; + thisOpt.fSet = 0; + thisOpt.fStep = 1; + break; + default: + // all other type-specific values have default constructors + break; + } thisOpt.hide = COPT_ALWAYS_HIDE; thisOpt.setSortPos( sPageIn );