From e01e2f1ae0ce45240e8f4129998d8fa3c999c156 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 21 Jan 2024 17:50:45 +0400 Subject: [PATCH] Fix magic effects in the editor --- apps/opencs/model/world/collection.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/opencs/model/world/collection.hpp b/apps/opencs/model/world/collection.hpp index 9db6b3b042..c10266a101 100644 --- a/apps/opencs/model/world/collection.hpp +++ b/apps/opencs/model/world/collection.hpp @@ -15,11 +15,13 @@ #include #include +#include #include #include #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(index)); + } + inline ESM::RefId getRecordId(const LandTexture& record) { return ESM::RefId::stringRefId(LandTexture::createUniqueRecordId(record.mPluginIndex, record.mIndex));