1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 09:39:51 +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 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;
if (esm.peekNextSub("RESP"))
mLastRespawn.load(esm, "RESP");
2022-09-22 21:26:05 +03:00
}
2022-09-22 21:26:05 +03:00
void CellState::save(ESMWriter& esm) const
{
2023-02-21 23:26:40 +01:00
if (mIsInterior)
2022-09-22 21:26:05 +03:00
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);
}
}