forked from mirror/openmw-tes3mp
Add NAME and DELE handling to Script record
This commit is contained in:
parent
9ac20a3355
commit
d2c15647a3
2 changed files with 14 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
#include "defs.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
@ -65,6 +66,10 @@ namespace ESM
|
|||
mData = data.mData;
|
||||
mId = data.mName.toString();
|
||||
|
||||
// In scripts DELE sub-record appears after a header.
|
||||
// The script data is following after DELE in this case.
|
||||
mIsDeleted = readDeleSubRecord(esm);
|
||||
|
||||
mVarNames.clear();
|
||||
|
||||
while (esm.hasMoreSubs())
|
||||
|
@ -106,6 +111,11 @@ namespace ESM
|
|||
|
||||
esm.writeHNT("SCHD", data, 52);
|
||||
|
||||
if (mIsDeleted)
|
||||
{
|
||||
writeDeleSubRecord(esm);
|
||||
}
|
||||
|
||||
if (!mVarNames.empty())
|
||||
{
|
||||
esm.startSubRecord("SCVR");
|
||||
|
@ -136,6 +146,8 @@ namespace ESM
|
|||
mScriptText = "Begin \"" + mId + "\"\n\nEnd " + mId + "\n";
|
||||
else
|
||||
mScriptText = "Begin " + mId + "\n\nEnd " + mId + "\n";
|
||||
|
||||
mIsDeleted = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ public:
|
|||
/// Script source code
|
||||
std::string mScriptText;
|
||||
|
||||
bool mIsDeleted;
|
||||
|
||||
void load(ESMReader &esm);
|
||||
void save(ESMWriter &esm) const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue