mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 19:19:55 +00:00
29 lines
561 B
C++
29 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));
|
|
}
|
|
}
|
|
|
|
}
|