You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3coop/components/esm/magiceffects.cpp

30 lines
561 B
C++

#include "magiceffects.hpp"
#include "esmwriter.hpp"
#include "esmreader.hpp"
namespace ESM
{
void MagicEffects::save(ESMWriter &esm) const
{
for (std::map<int, int>::const_iterator it = mEffects.begin(); it != mEffects.end(); ++it)
{
esm.writeHNT("EFID", it->first);
esm.writeHNT("BASE", it->second);
}
}
void MagicEffects::load(ESMReader &esm)
{
while (esm.isNextSub("EFID"))
{
int id, base;
esm.getHT(id);
esm.getHNT(base, "BASE");
mEffects.insert(std::make_pair(id, base));
}
}
}