mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 21:40:15 +00:00
Add missing UniversalId::mClass initialization
This commit is contained in:
parent
c97d0b5252
commit
94409ce172
@ -221,6 +221,23 @@ namespace
|
||||
|
||||
return std::to_string(value);
|
||||
}
|
||||
|
||||
CSMWorld::UniversalId::Class getClassByType(CSMWorld::UniversalId::Type type)
|
||||
{
|
||||
if (const auto it
|
||||
= std::find_if(std::begin(sIdArg), std::end(sIdArg), [&](const TypeData& v) { return v.mType == type; });
|
||||
it != std::end(sIdArg))
|
||||
return it->mClass;
|
||||
if (const auto it = std::find_if(
|
||||
std::begin(sIndexArg), std::end(sIndexArg), [&](const TypeData& v) { return v.mType == type; });
|
||||
it != std::end(sIndexArg))
|
||||
return it->mClass;
|
||||
if (const auto it
|
||||
= std::find_if(std::begin(sNoArg), std::end(sNoArg), [&](const TypeData& v) { return v.mType == type; });
|
||||
it != std::end(sNoArg))
|
||||
return it->mClass;
|
||||
throw std::logic_error("invalid UniversalId type: " + std::to_string(type));
|
||||
}
|
||||
}
|
||||
|
||||
CSMWorld::UniversalId::UniversalId(const std::string& universalId)
|
||||
@ -330,7 +347,8 @@ CSMWorld::UniversalId::UniversalId(Type type, ESM::RefId id)
|
||||
}
|
||||
|
||||
CSMWorld::UniversalId::UniversalId(Type type, const UniversalId& id)
|
||||
: mType(type)
|
||||
: mClass(getClassByType(type))
|
||||
, mType(type)
|
||||
, mValue(id.mValue)
|
||||
{
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user