mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Add functions to read and write ESM::RefId and use them
To be later changed with another implementation.
This commit is contained in:
parent
bf0da418f9
commit
6d261d38dd
68 changed files with 272 additions and 190 deletions
|
@ -8,7 +8,7 @@ namespace ESM
|
|||
|
||||
void GlobalScript::load(ESMReader& esm)
|
||||
{
|
||||
mId = ESM::RefId::stringRefId(esm.getHNString("NAME"));
|
||||
mId = esm.getHNRefId("NAME");
|
||||
|
||||
mLocals.load(esm);
|
||||
|
||||
|
@ -16,14 +16,14 @@ namespace ESM
|
|||
esm.getHNOT(mRunning, "RUN_");
|
||||
|
||||
mTargetRef = RefNum{};
|
||||
mTargetId = ESM::RefId::stringRefId(esm.getHNOString("TARG"));
|
||||
mTargetId = esm.getHNORefId("TARG");
|
||||
if (esm.peekNextSub("FRMR"))
|
||||
mTargetRef.load(esm, true, "FRMR");
|
||||
}
|
||||
|
||||
void GlobalScript::save(ESMWriter& esm) const
|
||||
{
|
||||
esm.writeHNString("NAME", mId.getRefIdString());
|
||||
esm.writeHNRefId("NAME", mId);
|
||||
|
||||
mLocals.save(esm);
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace ESM
|
|||
|
||||
if (!mTargetId.empty())
|
||||
{
|
||||
esm.writeHNOString("TARG", mTargetId.getRefIdString());
|
||||
esm.writeHNORefId("TARG", mTargetId);
|
||||
if (mTargetRef.isSet())
|
||||
mTargetRef.save(esm, true, "FRMR");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue