1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-29 23:38:27 +00:00
openmw/components/esm3/cellstate.cpp

35 lines
694 B
C++

#include "cellstate.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include <components/esm/defs.hpp>
#include <components/esm3/cellid.hpp>
namespace ESM
{
void CellState::load(ESMReader& esm)
{
mWaterLevel = 0;
esm.getHNOT(mWaterLevel, "WLVL");
mHasFogOfWar = false;
esm.getHNOT(mHasFogOfWar, "HFOW");
mLastRespawn.mDay = 0;
mLastRespawn.mHour = 0;
esm.getHNOT(mLastRespawn, "RESP");
}
void CellState::save(ESMWriter& esm) const
{
if (!mId.mPaged)
esm.writeHNT("WLVL", mWaterLevel);
esm.writeHNT("HFOW", mHasFogOfWar);
esm.writeHNT("RESP", mLastRespawn);
}
}