mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo esm typo
This commit is contained in:
parent
c263bbf0f6
commit
d1fb854521
448 changed files with 686 additions and 683 deletions
36
components/esm3/globalscript.cpp
Normal file
36
components/esm3/globalscript.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include "globalscript.hpp"
|
||||
|
||||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
|
||||
void ESM::GlobalScript::load (ESMReader &esm)
|
||||
{
|
||||
mId = esm.getHNString ("NAME");
|
||||
|
||||
mLocals.load (esm);
|
||||
|
||||
mRunning = 0;
|
||||
esm.getHNOT (mRunning, "RUN_");
|
||||
|
||||
mTargetRef.unset();
|
||||
mTargetId = esm.getHNOString ("TARG");
|
||||
if (esm.peekNextSub("FRMR"))
|
||||
mTargetRef.load(esm, true, "FRMR");
|
||||
}
|
||||
|
||||
void ESM::GlobalScript::save (ESMWriter &esm) const
|
||||
{
|
||||
esm.writeHNString ("NAME", mId);
|
||||
|
||||
mLocals.save (esm);
|
||||
|
||||
if (mRunning)
|
||||
esm.writeHNT ("RUN_", mRunning);
|
||||
|
||||
if (!mTargetId.empty())
|
||||
{
|
||||
esm.writeHNOString ("TARG", mTargetId);
|
||||
if (mTargetRef.isSet())
|
||||
mTargetRef.save (esm, true, "FRMR");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue