1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 12:32:36 +00:00
OpenMW/components/esm3/cellstate.cpp

33 lines
620 B
C++
Raw Normal View History

#include "cellstate.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
2022-09-22 21:26:05 +03:00
void CellState::load(ESMReader& esm)
{
mWaterLevel = 0;
esm.getHNOT(mWaterLevel, "WLVL");
2022-09-22 21:26:05 +03:00
mHasFogOfWar = false;
esm.getHNOT(mHasFogOfWar, "HFOW");
2022-09-22 21:26:05 +03:00
mLastRespawn.mDay = 0;
mLastRespawn.mHour = 0;
esm.getHNOT(mLastRespawn, "RESP");
}
2022-09-22 21:26:05 +03:00
void CellState::save(ESMWriter& esm) const
{
if (!mId.mPaged)
esm.writeHNT("WLVL", mWaterLevel);
2022-09-22 21:26:05 +03:00
esm.writeHNT("HFOW", mHasFogOfWar);
2022-09-22 21:26:05 +03:00
esm.writeHNT("RESP", mLastRespawn);
}
}