1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00
OpenMW/components/esm3/creaturelevliststate.cpp

32 lines
619 B
C++
Raw Normal View History

#include "creaturelevliststate.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
2022-09-22 18:26:05 +00:00
void CreatureLevListState::load(ESMReader& esm)
{
ObjectState::load(esm);
mSpawnActorId = -1;
2022-09-22 18:26:05 +00:00
esm.getHNOT(mSpawnActorId, "SPAW");
mSpawn = false;
2022-09-22 18:26:05 +00:00
esm.getHNOT(mSpawn, "RESP");
}
2022-09-22 18:26:05 +00:00
void CreatureLevListState::save(ESMWriter& esm, bool inInventory) const
{
ObjectState::save(esm, inInventory);
if (mSpawnActorId != -1)
2022-09-22 18:26:05 +00:00
esm.writeHNT("SPAW", mSpawnActorId);
if (mSpawn)
2022-09-22 18:26:05 +00:00
esm.writeHNT("RESP", mSpawn);
}
}