forked from mirror/openmw-tes3mp
include targeted script data in saved games
This commit is contained in:
parent
8241ee59c3
commit
e9377ad5c4
3 changed files with 8 additions and 0 deletions
|
@ -113,6 +113,8 @@ namespace MWScript
|
||||||
|
|
||||||
script.mRunning = iter->second.mRunning ? 1 : 0;
|
script.mRunning = iter->second.mRunning ? 1 : 0;
|
||||||
|
|
||||||
|
script.mTargetId = iter->second.mId;
|
||||||
|
|
||||||
writer.startRecord (ESM::REC_GSCR);
|
writer.startRecord (ESM::REC_GSCR);
|
||||||
script.save (writer);
|
script.save (writer);
|
||||||
writer.endRecord (ESM::REC_GSCR);
|
writer.endRecord (ESM::REC_GSCR);
|
||||||
|
@ -145,6 +147,7 @@ namespace MWScript
|
||||||
|
|
||||||
iter->second.mRunning = script.mRunning!=0;
|
iter->second.mRunning = script.mRunning!=0;
|
||||||
iter->second.mLocals.read (script.mLocals, script.mId);
|
iter->second.mLocals.read (script.mLocals, script.mId);
|
||||||
|
iter->second.mId = script.mTargetId;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ void ESM::GlobalScript::load (ESMReader &esm)
|
||||||
|
|
||||||
mRunning = 0;
|
mRunning = 0;
|
||||||
esm.getHNOT (mRunning, "RUN_");
|
esm.getHNOT (mRunning, "RUN_");
|
||||||
|
|
||||||
|
mTargetId = esm.getHNOString ("TARG");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESM::GlobalScript::save (ESMWriter &esm) const
|
void ESM::GlobalScript::save (ESMWriter &esm) const
|
||||||
|
@ -22,4 +24,6 @@ void ESM::GlobalScript::save (ESMWriter &esm) const
|
||||||
|
|
||||||
if (mRunning)
|
if (mRunning)
|
||||||
esm.writeHNT ("RUN_", mRunning);
|
esm.writeHNT ("RUN_", mRunning);
|
||||||
|
|
||||||
|
esm.writeHNOString ("TARG", mTargetId);
|
||||||
}
|
}
|
|
@ -15,6 +15,7 @@ namespace ESM
|
||||||
std::string mId;
|
std::string mId;
|
||||||
Locals mLocals;
|
Locals mLocals;
|
||||||
int mRunning;
|
int mRunning;
|
||||||
|
std::string mTargetId; // for targeted scripts
|
||||||
|
|
||||||
void load (ESMReader &esm);
|
void load (ESMReader &esm);
|
||||||
void save (ESMWriter &esm) const;
|
void save (ESMWriter &esm) const;
|
||||||
|
|
Loading…
Reference in a new issue