mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03:00
NPC/creature persistence flag
This commit is contained in:
parent
9fee99d56c
commit
8a3d3f954b
13 changed files with 45 additions and 7 deletions
|
@ -15,8 +15,9 @@ ESM_Context ESMReader::getContext()
|
|||
return mCtx;
|
||||
}
|
||||
|
||||
ESMReader::ESMReader():
|
||||
mBuffer(50*1024)
|
||||
ESMReader::ESMReader()
|
||||
: mBuffer(50*1024)
|
||||
, mRecordFlags(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ public:
|
|||
follows the header, ie beyond the entire record. You should use
|
||||
leftRec to orient yourself inside the record itself.
|
||||
*/
|
||||
void getRecHeader() { uint32_t u; getRecHeader(u); }
|
||||
void getRecHeader() { getRecHeader(mRecordFlags); }
|
||||
void getRecHeader(uint32_t &flags);
|
||||
|
||||
bool hasMoreRecs() const { return mCtx.leftFile > 0; }
|
||||
|
@ -249,11 +249,16 @@ public:
|
|||
/// Sets font encoder for ESM strings
|
||||
void setEncoder(ToUTF8::Utf8Encoder* encoder);
|
||||
|
||||
/// Get record flags of last record
|
||||
unsigned int getRecordFlags() { return mRecordFlags; }
|
||||
|
||||
private:
|
||||
Ogre::DataStreamPtr mEsm;
|
||||
|
||||
ESM_Context mCtx;
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
|
||||
// Special file signifier (see SpecialFile enum above)
|
||||
|
||||
// Buffer for ESM strings
|
||||
|
|
|
@ -7,6 +7,8 @@ namespace ESM {
|
|||
|
||||
void Creature::load(ESMReader &esm)
|
||||
{
|
||||
mPersistent = esm.getRecordFlags() & 0x0400;
|
||||
|
||||
mModel = esm.getHNString("MODL");
|
||||
mOriginal = esm.getHNOString("CNAM");
|
||||
mName = esm.getHNOString("FNAM");
|
||||
|
|
|
@ -69,6 +69,9 @@ struct Creature
|
|||
NPDTstruct mData;
|
||||
|
||||
int mFlags;
|
||||
|
||||
bool mPersistent;
|
||||
|
||||
float mScale;
|
||||
|
||||
std::string mId, mModel, mName, mScript;
|
||||
|
|
|
@ -10,6 +10,8 @@ void NPC::load(ESMReader &esm)
|
|||
{
|
||||
mNpdt52.mGold = -10;
|
||||
|
||||
mPersistent = esm.getRecordFlags() & 0x0400;
|
||||
|
||||
mModel = esm.getHNOString("MODL");
|
||||
mName = esm.getHNOString("FNAM");
|
||||
|
||||
|
|
|
@ -100,6 +100,8 @@ struct NPC
|
|||
|
||||
int mFlags;
|
||||
|
||||
bool mPersistent;
|
||||
|
||||
InventoryList mInventory;
|
||||
SpellList mSpells;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue