Revert "Light charge handling fix"

This reverts commit 5e0428243b.
This commit is contained in:
scrawl 2015-01-23 02:32:38 +01:00
parent fa4718283d
commit b95748d044
14 changed files with 87 additions and 47 deletions

View file

@ -24,9 +24,9 @@ void ESM::ObjectState::load (ESMReader &esm)
esm.getHNOT (mLocalRotation, "LROT", 12);
// obsolete
int unused;
esm.getHNOT(unused, "LTIM");
// used for lights only
mTime = 0;
esm.getHNOT (mTime, "LTIM");
// FIXME: assuming "false" as default would make more sense, but also break compatibility with older save files
mHasCustomState = true;
@ -55,6 +55,9 @@ void ESM::ObjectState::save (ESMWriter &esm, bool inInventory) const
esm.writeHNT ("LROT", mLocalRotation, 12);
}
if (mTime)
esm.writeHNT ("LTIM", mTime);
if (!mHasCustomState)
esm.writeHNT ("HCUS", false);
}
@ -71,6 +74,7 @@ void ESM::ObjectState::blank()
mPosition.rot[i] = 0;
mLocalRotation[i] = 0;
}
mTime = 0;
mHasCustomState = true;
}