restore INGR and MGEF

actorid
greye 12 years ago
parent 2d5ddd104b
commit 09195894cf

@ -13,7 +13,6 @@ void Ingredient::load(ESMReader &esm)
esm.getHNT(mData, "IRDT", 56); esm.getHNT(mData, "IRDT", 56);
mScript = esm.getHNOString("SCRI"); mScript = esm.getHNOString("SCRI");
mIcon = esm.getHNOString("ITEX"); mIcon = esm.getHNOString("ITEX");
/*
// horrible hack to fix broken data in records // horrible hack to fix broken data in records
for (int i=0; i<4; ++i) for (int i=0; i<4; ++i)
{ {
@ -36,7 +35,6 @@ void Ingredient::load(ESMReader &esm)
mData.mSkills[i] = -1; mData.mSkills[i] = -1;
} }
} }
*/
} }
void Ingredient::save(ESMWriter &esm) void Ingredient::save(ESMWriter &esm)

@ -3,6 +3,8 @@
#include "esm_reader.hpp" #include "esm_reader.hpp"
#include "esm_writer.hpp" #include "esm_writer.hpp"
#include <stdio.h>
namespace namespace
{ {
const int NumberOfHardcodedFlags = 143; const int NumberOfHardcodedFlags = 143;
@ -36,10 +38,9 @@ void MagicEffect::load(ESMReader &esm)
esm.getHNT(mIndex, "INDX"); esm.getHNT(mIndex, "INDX");
esm.getHNT(mData, "MEDT", 36); esm.getHNT(mData, "MEDT", 36);
/*
if (mIndex>=0 && mIndex<NumberOfHardcodedFlags) if (mIndex>=0 && mIndex<NumberOfHardcodedFlags)
mData.mFlags |= HardcodedFlags[mIndex]; mData.mFlags |= HardcodedFlags[mIndex];
*/
mIcon = esm.getHNOString("ITEX"); mIcon = esm.getHNOString("ITEX");
mParticle = esm.getHNOString("PTEX"); mParticle = esm.getHNOString("PTEX");
@ -58,7 +59,12 @@ void MagicEffect::load(ESMReader &esm)
void MagicEffect::save(ESMWriter &esm) void MagicEffect::save(ESMWriter &esm)
{ {
esm.writeHNT("INDX", mIndex); esm.writeHNT("INDX", mIndex);
mData.mFlags &= 0xe00;
esm.writeHNT("MEDT", mData, 36); esm.writeHNT("MEDT", mData, 36);
if (mIndex>=0 && mIndex<NumberOfHardcodedFlags) {
mData.mFlags |= HardcodedFlags[mIndex];
}
esm.writeHNOCString("ITEX", mIcon); esm.writeHNOCString("ITEX", mIcon);
esm.writeHNOCString("PTEX", mParticle); esm.writeHNOCString("PTEX", mParticle);

Loading…
Cancel
Save