1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 21:29:56 +00:00
openmw/components/esm3/cellstate.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
658 B
C++
Raw Normal View History

#include "cellstate.hpp"
#include "esmreader.hpp"
#include "esmwriter.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;
if (esm.peekNextSub("RESP"))
mLastRespawn.load(esm, "RESP");
}
void CellState::save(ESMWriter& esm) const
{
2023-02-21 22:26:40 +00:00
if (mIsInterior)
esm.writeHNT("WLVL", mWaterLevel);
esm.writeHNT("HFOW", mHasFogOfWar);
esm.writeHNT("RESP", mLastRespawn);
}
}