mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:29:55 +00:00
d1fb854521
esm typo esm typo
35 lines
707 B
C++
35 lines
707 B
C++
#include "magiceffects.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
|
#include "esmreader.hpp"
|
|
|
|
namespace ESM
|
|
{
|
|
|
|
void MagicEffects::save(ESMWriter &esm) const
|
|
{
|
|
for (const auto& [key, params] : mEffects)
|
|
{
|
|
esm.writeHNT("EFID", key);
|
|
esm.writeHNT("BASE", params.first);
|
|
esm.writeHNT("MODI", params.second);
|
|
}
|
|
}
|
|
|
|
void MagicEffects::load(ESMReader &esm)
|
|
{
|
|
while (esm.isNextSub("EFID"))
|
|
{
|
|
int id;
|
|
std::pair<int, float> params;
|
|
esm.getHT(id);
|
|
esm.getHNT(params.first, "BASE");
|
|
if(esm.getFormat() < 17)
|
|
params.second = 0.f;
|
|
else
|
|
esm.getHNT(params.second, "MODI");
|
|
mEffects.emplace(id, params);
|
|
}
|
|
}
|
|
|
|
}
|