1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-05 06:40:09 +00:00
OpenMW/components/esm3/npcstate.cpp

43 lines
726 B
C++
Raw Normal View History

#include "npcstate.hpp"
namespace ESM
{
2022-09-22 21:26:05 +03:00
void NpcState::load(ESMReader& esm)
{
2022-09-22 21:26:05 +03:00
ObjectState::load(esm);
2014-02-16 15:06:34 +01:00
2022-09-22 21:26:05 +03:00
if (mHasCustomState)
{
mInventory.load(esm);
2014-02-16 15:06:34 +01:00
2022-09-22 21:26:05 +03:00
mNpcStats.load(esm);
2022-09-22 21:26:05 +03:00
mCreatureStats.load(esm);
}
}
2022-09-22 21:26:05 +03:00
void NpcState::save(ESMWriter& esm, bool inInventory) const
{
2022-09-22 21:26:05 +03:00
ObjectState::save(esm, inInventory);
2014-02-16 15:06:34 +01:00
2022-09-22 21:26:05 +03:00
if (mHasCustomState)
{
mInventory.save(esm);
2014-02-16 15:06:34 +01:00
2022-09-22 21:26:05 +03:00
mNpcStats.save(esm);
mCreatureStats.save(esm);
}
}
2022-09-22 21:26:05 +03:00
void NpcState::blank()
{
ObjectState::blank();
mNpcStats.blank();
mCreatureStats.blank();
mHasCustomState = true;
}
}