mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-11 18:37:08 +00:00
b1bd236345
Had to add special reading code to openmw, because the variable names are not stored.
29 lines
649 B
C++
29 lines
649 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);
|
|
}
|
|
}
|