1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 19:19:55 +00:00
openmw-tes3mp/components/esm/locals.cpp
scrawl 67bd6cd708 Remove empty line at the beginning of files
git ls-files -z | xargs -0 sed -i '1{/^$/d}'
2015-08-18 23:06:12 +02:00

27 lines
648 B
C++

#include "locals.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
void ESM::Locals::load (ESMReader &esm)
{
while (esm.isNextSub ("LOCA"))
{
std::string id = esm.getHString();
Variant value;
value.read (esm, Variant::Format_Local);
mVariables.push_back (std::make_pair (id, value));
}
}
void ESM::Locals::save (ESMWriter &esm) const
{
for (std::vector<std::pair<std::string, Variant> >::const_iterator iter (mVariables.begin());
iter!=mVariables.end(); ++iter)
{
esm.writeHNString ("LOCA", iter->first);
iter->second.write (esm, Variant::Format_Local);
}
}