mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-07 12:40:01 +00:00
Preserve "blocked" record flags when saving with OpenCS. This will help outputs of OpenCS to be used with vanilla Morrowind.
Sample use case: users are using the Morrowind Code Patch feature that allows modders to enable this flag to differentiate editor-made potions from player crafted potions for tooltips.
This commit is contained in:
parent
66f028c4a1
commit
7227a83e60
@ -108,7 +108,7 @@ namespace CSMDoc
|
||||
state == CSMWorld::RecordBase::State_ModifiedOnly ||
|
||||
state == CSMWorld::RecordBase::State_Deleted)
|
||||
{
|
||||
writer.startRecord (record.sRecordId);
|
||||
writer.startRecord (record.sRecordId, record.mRecordFlags);
|
||||
record.save (writer, state == CSMWorld::RecordBase::State_Deleted);
|
||||
writer.endRecord (record.sRecordId);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ unsigned int ESM::DebugProfile::sRecordId = REC_DBGP;
|
||||
void ESM::DebugProfile::load (ESMReader& esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
while (esm.hasMoreSubs())
|
||||
{
|
||||
|
@ -19,6 +19,7 @@ namespace ESM
|
||||
Flag_Global = 4 // make available from main menu (i.e. not location specific)
|
||||
};
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
std::string mDescription;
|
||||
|
@ -9,6 +9,7 @@ unsigned int ESM::Filter::sRecordId = REC_FILT;
|
||||
void ESM::Filter::load (ESMReader& esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
while (esm.hasMoreSubs())
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ namespace ESM
|
||||
{
|
||||
static unsigned int sRecordId;
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
std::string mDescription;
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void BodyPart::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasName = false;
|
||||
bool hasData = false;
|
||||
|
@ -58,6 +58,7 @@ struct BodyPart
|
||||
};
|
||||
|
||||
BYDTstruct mData;
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mModel, mRace;
|
||||
|
||||
void load(ESMReader &esm, bool &isDeleted);
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void BirthSign::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mPowers.mList.clear();
|
||||
|
||||
|
@ -17,6 +17,7 @@ struct BirthSign
|
||||
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||||
static std::string getRecordType() { return "BirthSign"; }
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mName, mDescription, mTexture;
|
||||
|
||||
// List of powers and abilities that come with this birth sign.
|
||||
|
@ -41,6 +41,7 @@ namespace ESM
|
||||
void Class::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasName = false;
|
||||
bool hasData = false;
|
||||
|
@ -70,6 +70,7 @@ struct Class
|
||||
///< Throws an exception for invalid values of \a index.
|
||||
}; // 60 bytes
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mName, mDescription;
|
||||
CLDTstruct mData;
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void Enchantment::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
mEffects.mList.clear();
|
||||
|
||||
bool hasName = false;
|
||||
|
@ -42,6 +42,7 @@ struct Enchantment
|
||||
int mFlags;
|
||||
};
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
ENDTstruct mData;
|
||||
EffectList mEffects;
|
||||
|
@ -29,6 +29,7 @@ namespace ESM
|
||||
void Faction::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mReactions.clear();
|
||||
for (int i=0;i<10;++i)
|
||||
|
@ -34,6 +34,7 @@ struct Faction
|
||||
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||||
static std::string getRecordType() { return "Faction"; }
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mName;
|
||||
|
||||
struct FADTstruct
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void Global::load (ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mId = esm.getHNString ("NAME");
|
||||
|
||||
|
@ -21,6 +21,7 @@ struct Global
|
||||
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||||
static std::string getRecordType() { return "Global"; }
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
Variant mValue;
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void GameSetting::load (ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mId = esm.getHNString("NAME");
|
||||
mValue.read (esm, ESM::Variant::Format_Gmst);
|
||||
|
@ -22,6 +22,7 @@ struct GameSetting
|
||||
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||||
static std::string getRecordType() { return "GameSetting"; }
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
Variant mValue;
|
||||
|
@ -189,6 +189,7 @@ namespace ESM
|
||||
void MagicEffect::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false; // MagicEffect record can't be deleted now (may be changed in the future)
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
esm.getHNT(mIndex, "INDX");
|
||||
|
||||
|
@ -16,6 +16,7 @@ struct MagicEffect
|
||||
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||||
static std::string getRecordType() { return "MagicEffect"; }
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
enum Flags
|
||||
|
@ -21,6 +21,7 @@ namespace ESM
|
||||
void Race::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mPowers.mList.clear();
|
||||
|
||||
|
@ -65,6 +65,7 @@ struct Race
|
||||
|
||||
RADTstruct mData;
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mName, mDescription;
|
||||
SpellList mPowers;
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void Region::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasName = false;
|
||||
while (esm.hasMoreSubs())
|
||||
|
@ -45,6 +45,7 @@ struct Region
|
||||
WEATstruct mData;
|
||||
int mMapColor; // RGBA
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
// sleepList refers to a leveled list of creatures you can meet if
|
||||
// you sleep outside in this region.
|
||||
std::string mId, mName, mSleepList;
|
||||
|
@ -83,6 +83,7 @@ namespace ESM
|
||||
void Script::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mVarNames.clear();
|
||||
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
Script::SCHDstruct mData;
|
||||
};
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
SCHDstruct mData;
|
||||
|
@ -130,6 +130,7 @@ namespace ESM
|
||||
void Skill::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false; // Skill record can't be deleted now (may be changed in the future)
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasIndex = false;
|
||||
bool hasData = false;
|
||||
|
@ -22,6 +22,7 @@ struct Skill
|
||||
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||||
static std::string getRecordType() { return "Skill"; }
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
struct SKDTstruct
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void SoundGenerator::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasName = false;
|
||||
bool hasData = false;
|
||||
|
@ -34,6 +34,7 @@ struct SoundGenerator
|
||||
// Type
|
||||
int mType;
|
||||
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mCreature, mSound;
|
||||
|
||||
void load(ESMReader &esm, bool &isDeleted);
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void Sound::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasName = false;
|
||||
bool hasData = false;
|
||||
|
@ -21,6 +21,7 @@ struct Sound
|
||||
static std::string getRecordType() { return "Sound"; }
|
||||
|
||||
SOUNstruct mData;
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mSound;
|
||||
|
||||
void load(ESMReader &esm, bool &isDeleted);
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void Spell::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
mEffects.mList.clear();
|
||||
|
||||
|
@ -42,6 +42,7 @@ struct Spell
|
||||
};
|
||||
|
||||
SPDTstruct mData;
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId, mName;
|
||||
EffectList mEffects;
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace ESM
|
||||
void StartScript::load(ESMReader &esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
bool hasData = false;
|
||||
bool hasName = false;
|
||||
|
@ -24,6 +24,7 @@ struct StartScript
|
||||
static std::string getRecordType() { return "StartScript"; }
|
||||
|
||||
std::string mData;
|
||||
unsigned int mRecordFlags;
|
||||
std::string mId;
|
||||
|
||||
// Load a record and add it to the list
|
||||
|
Loading…
x
Reference in New Issue
Block a user