diff --git a/src/C4StartupOptionsAdvancedConfigDialog.cpp b/src/C4StartupOptionsAdvancedConfigDialog.cpp index 254bee40..7f1d549a 100644 --- a/src/C4StartupOptionsAdvancedConfigDialog.cpp +++ b/src/C4StartupOptionsAdvancedConfigDialog.cpp @@ -62,18 +62,25 @@ class StdCompilerConfigGuiBase : public StdCompiler NameGuard Name(const char *name) override { - lastName = name; - if (++level == 1) + if (++level > 2) { - dialog->ChangeSection(name); + ignore = true; + } + else + { + lastName = name; + if (level == 1) + { + dialog->ChangeSection(name); + } } - assert(level <= 2); return StdCompiler::Name(name); } void NameEnd(bool breaking = false) override { assert(level > 0); --level; + ignore = false; return StdCompiler::NameEnd(breaking); } protected: @@ -85,6 +92,8 @@ class StdCompilerConfigGuiBase : public StdCompiler template void HandleSettingInternal(T &setting, Args &&... args) { + if (ignore) return; + try { self().HandleSetting(lastName, setting, std::forward(args)...); @@ -97,6 +106,7 @@ class StdCompilerConfigGuiBase : public StdCompiler std::string lastName; std::size_t level{0}; + bool ignore{false}; }; class StdCompilerConfigGuiRead : public StdCompilerConfigGuiBase