1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 19:15:41 +00:00

Merge branch 'magic_effects_fix' into 'master'

Fix magic effects in the editor

Closes #7481

See merge request OpenMW/openmw!3798
This commit is contained in:
Evil Eye 2024-01-26 16:33:51 +00:00
commit aa9a99bde5

View file

@ -15,11 +15,13 @@
#include <QVariant>
#include <components/esm3/loaddial.hpp>
#include <components/esm3/loadmgef.hpp>
#include <components/esm3/loadskil.hpp>
#include <components/misc/strings/lower.hpp>
#include "collectionbase.hpp"
#include "columnbase.hpp"
#include "columnimp.hpp"
#include "info.hpp"
#include "land.hpp"
#include "landtexture.hpp"
@ -82,6 +84,17 @@ namespace CSMWorld
record.mIndex = index;
}
inline ESM::RefId getRecordId(const ESM::MagicEffect& record)
{
return ESM::RefId::stringRefId(CSMWorld::getStringId(record.mId));
}
inline void setRecordId(const ESM::RefId& id, ESM::MagicEffect& record)
{
int index = ESM::MagicEffect::indexNameToIndex(id.getRefIdString());
record.mId = ESM::RefId::index(ESM::REC_MGEF, static_cast<std::uint32_t>(index));
}
inline ESM::RefId getRecordId(const LandTexture& record)
{
return ESM::RefId::stringRefId(LandTexture::createUniqueRecordId(record.mPluginIndex, record.mIndex));