1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/apps/essimporter/importsplm.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.1 KiB
C++
Raw Normal View History

#include "importsplm.h"
#include <components/esm3/esmreader.hpp>
namespace ESSImport
{
void SPLM::load(ESM::ESMReader& esm)
{
while (esm.isNextSub("NAME"))
{
ActiveSpell spell;
esm.getHT(spell.mIndex);
esm.getHNT(spell.mSPDT, "SPDT");
spell.mTarget = esm.getHNOString("TNAM");
2022-09-22 18:26:05 +00:00
while (esm.isNextSub("NPDT"))
2022-09-22 18:26:05 +00:00
{
ActiveEffect effect;
esm.getHT(effect.mNPDT);
2022-09-22 18:26:05 +00:00
// Effect-specific subrecords can follow:
// - INAM for disintegration and bound effects
// - CNAM for summoning and command effects
// - VNAM for vampirism
// NOTE: There can be multiple INAMs per effect.
// TODO: Needs more research.
2022-09-22 18:26:05 +00:00
esm.skipHSubUntil("NAM0"); // sentinel
esm.getSubName();
esm.skipHSub();
2022-09-22 18:26:05 +00:00
spell.mActiveEffects.push_back(effect);
2022-09-22 18:26:05 +00:00
}
unsigned char xnam; // sentinel
esm.getHNT(xnam, "XNAM");
2022-09-22 18:26:05 +00:00
mActiveSpells.push_back(spell);
}
}
}