added creature/NPC state to saved games (only container/inventory for now)
parent
d2ec3ffdc8
commit
5b04c10e1d
@ -0,0 +1,16 @@
|
||||
|
||||
#include "creaturestate.hpp"
|
||||
|
||||
void ESM::CreatureState::load (ESMReader &esm)
|
||||
{
|
||||
ObjectState::load (esm);
|
||||
|
||||
mInventory.load (esm);
|
||||
}
|
||||
|
||||
void ESM::CreatureState::save (ESMWriter &esm, bool inInventory) const
|
||||
{
|
||||
ObjectState::save (esm, inInventory);
|
||||
|
||||
mInventory.save (esm);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
#ifndef OPENMW_ESM_CREATURESTATE_H
|
||||
#define OPENMW_ESM_CREATURESTATE_H
|
||||
|
||||
#include "objectstate.hpp"
|
||||
#include "inventorystate.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
// format 0, saved games only
|
||||
|
||||
struct CreatureState : public ObjectState
|
||||
{
|
||||
InventoryState mInventory;
|
||||
|
||||
virtual void load (ESMReader &esm);
|
||||
virtual void save (ESMWriter &esm, bool inInventory = false) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,16 @@
|
||||
|
||||
#include "npcstate.hpp"
|
||||
|
||||
void ESM::NpcState::load (ESMReader &esm)
|
||||
{
|
||||
ObjectState::load (esm);
|
||||
|
||||
mInventory.load (esm);
|
||||
}
|
||||
|
||||
void ESM::NpcState::save (ESMWriter &esm, bool inInventory) const
|
||||
{
|
||||
ObjectState::save (esm, inInventory);
|
||||
|
||||
mInventory.save (esm);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
#ifndef OPENMW_ESM_NPCSTATE_H
|
||||
#define OPENMW_ESM_NPCSTATE_H
|
||||
|
||||
#include "objectstate.hpp"
|
||||
#include "inventorystate.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
// format 0, saved games only
|
||||
|
||||
struct NpcState : public ObjectState
|
||||
{
|
||||
InventoryState mInventory;
|
||||
|
||||
virtual void load (ESMReader &esm);
|
||||
virtual void save (ESMWriter &esm, bool inInventory = false) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue