save MVRF subrecords

moveref
Marc Zinnschlag 10 years ago
parent a97f599e65
commit 89998a6a03

@ -314,10 +314,7 @@ void CSMDoc::WriteCellCollectionStage::perform (int stage, Messages& messages)
char ignore; char ignore;
stream >> ignore >> moved.mTarget[0] >> moved.mTarget[1]; stream >> ignore >> moved.mTarget[0] >> moved.mTarget[1];
mState.getWriter().startSubRecord ("MVRF"); ref.get().mRefNum.save (mState.getWriter(), false, "MVRF");
mState.getWriter().endRecord ("MVRF");
mState.getWriter().writeHNT ("FRMR", moved.mRefNum.mIndex, 4);
mState.getWriter().writeHNT ("CNDT", moved.mTarget, 8); mState.getWriter().writeHNT ("CNDT", moved.mTarget, 8);
} }

@ -12,15 +12,15 @@ void ESM::RefNum::load (ESMReader& esm, bool wide)
esm.getHNT (mIndex, "FRMR"); esm.getHNT (mIndex, "FRMR");
} }
void ESM::RefNum::save (ESMWriter &esm, bool wide) const void ESM::RefNum::save (ESMWriter &esm, bool wide, const std::string& tag) const
{ {
if (wide) if (wide)
esm.writeHNT ("FRMR", *this, 8); esm.writeHNT (tag, *this, 8);
else else
{ {
int refNum = (mIndex & 0xffffff) | ((mContentFile==-1 ? 0xff : mContentFile)<<24); int refNum = (mIndex & 0xffffff) | ((mContentFile==-1 ? 0xff : mContentFile)<<24);
esm.writeHNT ("FRMR", refNum, 4); esm.writeHNT (tag, refNum, 4);
} }
} }

@ -18,7 +18,7 @@ namespace ESM
void load (ESMReader& esm, bool wide = false); void load (ESMReader& esm, bool wide = false);
void save (ESMWriter &esm, bool wide = false) const; void save (ESMWriter &esm, bool wide = false, const std::string& tag = "FRMR") const;
}; };
/* Cell reference. This represents ONE object (of many) inside the /* Cell reference. This represents ONE object (of many) inside the

Loading…
Cancel
Save