1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 18:45:36 +00:00
openmw/components/esm3/cellstate.cpp

34 lines
658 B
C++
Raw Normal View History

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