1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-02 05:06:40 +00:00

Make ESM::StringRefId compatible with std::string UniversalId

This commit is contained in:
elsid 2023-12-29 13:10:13 +01:00
parent c53abd870b
commit 0fc78aa173
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625

View file

@ -360,6 +360,10 @@ const std::string& CSMWorld::UniversalId::getId() const
if (const std::string* result = std::get_if<std::string>(&mValue))
return *result;
if (const ESM::RefId* refId = std::get_if<ESM::RefId>(&mValue))
if (const ESM::StringRefId* result = refId->getIf<ESM::StringRefId>())
return result->getValue();
throw std::logic_error("invalid access to ID of " + ::toString(getArgumentType()) + " UniversalId");
}