2014-01-23 10:29:40 +00:00
|
|
|
#include "cellstate.hpp"
|
|
|
|
|
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
|
|
|
|
2022-04-11 22:18:39 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
|
|
|
|
void CellState::load(ESMReader& esm)
|
2014-01-23 10:29:40 +00:00
|
|
|
{
|
|
|
|
mWaterLevel = 0;
|
|
|
|
esm.getHNOT(mWaterLevel, "WLVL");
|
2014-05-11 00:07:28 +00:00
|
|
|
|
|
|
|
mHasFogOfWar = false;
|
|
|
|
esm.getHNOT(mHasFogOfWar, "HFOW");
|
2014-05-17 07:05:41 +00:00
|
|
|
|
|
|
|
mLastRespawn.mDay = 0;
|
|
|
|
mLastRespawn.mHour = 0;
|
2023-07-30 09:37:32 +00:00
|
|
|
if (esm.peekNextSub("RESP"))
|
|
|
|
mLastRespawn.load(esm, "RESP");
|
2014-01-23 10:29:40 +00:00
|
|
|
}
|
|
|
|
|
2022-04-11 22:18:39 +00:00
|
|
|
void CellState::save(ESMWriter& esm) const
|
2014-01-23 10:29:40 +00:00
|
|
|
{
|
2023-02-21 22:26:40 +00:00
|
|
|
if (mIsInterior)
|
2014-01-23 10:29:40 +00:00
|
|
|
esm.writeHNT("WLVL", mWaterLevel);
|
2014-05-11 00:07:28 +00:00
|
|
|
|
2014-05-17 07:05:41 +00:00
|
|
|
esm.writeHNT("HFOW", mHasFogOfWar);
|
|
|
|
|
|
|
|
esm.writeHNT("RESP", mLastRespawn);
|
2014-05-11 00:07:28 +00:00
|
|
|
}
|
2022-04-11 22:18:39 +00:00
|
|
|
|
|
|
|
}
|