mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 22:15:34 +00:00
Merge remote-tracking branch 'cc9cii/records-without-name'
This commit is contained in:
commit
4106f8d867
1 changed files with 7 additions and 10 deletions
|
@ -7,6 +7,8 @@
|
||||||
#include "../world/idcollection.hpp"
|
#include "../world/idcollection.hpp"
|
||||||
#include "../world/scope.hpp"
|
#include "../world/scope.hpp"
|
||||||
|
|
||||||
|
#include <components/esm/defs.hpp>
|
||||||
|
|
||||||
#include "savingstate.hpp"
|
#include "savingstate.hpp"
|
||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
|
@ -103,19 +105,14 @@ namespace CSMDoc
|
||||||
if (state==CSMWorld::RecordBase::State_Modified ||
|
if (state==CSMWorld::RecordBase::State_Modified ||
|
||||||
state==CSMWorld::RecordBase::State_ModifiedOnly)
|
state==CSMWorld::RecordBase::State_ModifiedOnly)
|
||||||
{
|
{
|
||||||
// FIXME: A quick Workaround to support SKIL records which should not write NAME.
|
// FIXME: A quick Workaround to support records which should not write
|
||||||
// If there are more idcollection records that don't use NAME then a more
|
// NAME, including SKIL, MGEF and SCPT. If there are many more
|
||||||
// generic solution may be required. The conversion code was simply
|
// idcollection records that doesn't use NAME then a more generic
|
||||||
// copied from esmwriter. There's room for improving speed a little bit
|
// solution may be required.
|
||||||
// here if it turns out to be an issue.
|
|
||||||
uint32_t name = mCollection.getRecord (stage).mModified.sRecordId;
|
uint32_t name = mCollection.getRecord (stage).mModified.sRecordId;
|
||||||
mState.getWriter().startRecord (name);
|
mState.getWriter().startRecord (name);
|
||||||
std::string type;
|
|
||||||
for (int i=0; i<4; ++i)
|
|
||||||
/// \todo make endianess agnostic
|
|
||||||
type += reinterpret_cast<const char *> (&name)[i];
|
|
||||||
|
|
||||||
if(type != "SKIL")
|
if(name != ESM::REC_SKIL && name != ESM::REC_MGEF && name != ESM::REC_SCPT)
|
||||||
mState.getWriter().writeHNCString ("NAME", mCollection.getId (stage));
|
mState.getWriter().writeHNCString ("NAME", mCollection.getId (stage));
|
||||||
mCollection.getRecord (stage).mModified.save (mState.getWriter());
|
mCollection.getRecord (stage).mModified.save (mState.getWriter());
|
||||||
mState.getWriter().endRecord (mCollection.getRecord (stage).mModified.sRecordId);
|
mState.getWriter().endRecord (mCollection.getRecord (stage).mModified.sRecordId);
|
||||||
|
|
Loading…
Reference in a new issue