mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-04 09:29:48 -06:00
Fix default value for Enums when the key is missing.
This commit is contained in:
@@ -281,9 +281,16 @@ public:
|
||||
}
|
||||
else if constexpr (std::is_enum_v<T>)
|
||||
{
|
||||
auto it = EnumTemplate->begin();
|
||||
|
||||
Value = EnumTemplate->at(section[Name].value_or<std::string>(static_cast<std::string>(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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user