diff --git a/UnleashedRecomp/user/config_detail.h b/UnleashedRecomp/user/config_detail.h index 4966f68..183bee0 100644 --- a/UnleashedRecomp/user/config_detail.h +++ b/UnleashedRecomp/user/config_detail.h @@ -281,9 +281,16 @@ public: } else if constexpr (std::is_enum_v) { - auto it = EnumTemplate->begin(); - - Value = EnumTemplate->at(section[Name].value_or(static_cast(it->first))); + std::string value = section[Name].value_or(std::string()); + auto it = EnumTemplate->find(value); + if (it != EnumTemplate->end()) + { + Value = it->second; + } + else + { + Value = DefaultValue; + } } else {