diff --git a/apps/opencs/model/world/collection.hpp b/apps/opencs/model/world/collection.hpp index dbbff2ed4a..83c8de656a 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));