1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:19:55 +00:00
openmw-tes3mp/components/esm/loadalch.cpp
2012-04-06 21:04:30 +02:00

26 lines
652 B
C++

#include "loadalch.hpp"
namespace ESM
{
void Potion::load(ESMReader &esm)
{
model = esm.getHNString("MODL");
icon = esm.getHNOString("TEXT"); // not ITEX here for some reason
script = esm.getHNOString("SCRI");
name = esm.getHNOString("FNAM");
esm.getHNT(data, "ALDT", 12);
effects.load(esm);
}
void Potion::save(ESMWriter &esm)
{
esm.writeHNString("MODL", model);
if (!icon.empty())
esm.writeHNString("TEXT", icon);
if (!script.empty())
esm.writeHNString("SCRI", script);
if (!name.empty())
esm.writeHNString("FNAM", name);
esm.writeHNT("ALDT", data, 12);
effects.save(esm);
}
}