forked from teamnwah/openmw-tes3coop
Adds the option to ignore "Base" records when running the verifier. (fixes #4466)
Adds a boolean setting to the user preferences. This setting is locally saved to all OpenMW-CS check stages. When a verification is done, the setting is updated on setup for each check stage. If set to true, the boolean value is then used to skip the verification process for every base record - minus some special cases where, e.g., counters are to be set first. Related issue: - Fixes #4466: Editor: Add option to ignore base records when running verifier (https://gitlab.com/OpenMW/openmw/issues/4466) Tests: The changes were successfully tested in OpenMW-CS by creating faulty "Base" and "Modified" records for every record type (if possible) and, then, running the verifier with and without the option respectively.
This commit is contained in:
parent
101f0b1579
commit
9d61d76e92
42 changed files with 260 additions and 70 deletions
|
@ -44,12 +44,13 @@
|
||||||
Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas
|
Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas
|
||||||
Bug #4458: AiWander console command handles idle chances incorrectly
|
Bug #4458: AiWander console command handles idle chances incorrectly
|
||||||
Bug #4459: NotCell dialogue condition doesn't support partial matches
|
Bug #4459: NotCell dialogue condition doesn't support partial matches
|
||||||
Feature #4256: Implement ToggleBorders (TB) console command
|
|
||||||
Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results
|
Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results
|
||||||
Feature #4222: 360° screenshots
|
Feature #4222: 360° screenshots
|
||||||
|
Feature #4256: Implement ToggleBorders (TB) console command
|
||||||
Feature #4324: Add CFBundleIdentifier in Info.plist to allow for macOS function key shortcuts
|
Feature #4324: Add CFBundleIdentifier in Info.plist to allow for macOS function key shortcuts
|
||||||
Feature #4345: Add equivalents for the command line commands to Launcher
|
Feature #4345: Add equivalents for the command line commands to Launcher
|
||||||
Feature #4444: Per-group KF-animation files support
|
Feature #4444: Per-group KF-animation files support
|
||||||
|
Feature #4466: (OpenMW-CS) Add option to ignore "Base" records when running verifier
|
||||||
|
|
||||||
0.44.0
|
0.44.0
|
||||||
------
|
------
|
||||||
|
|
|
@ -123,6 +123,7 @@ void CSMPrefs::State::declare()
|
||||||
declareEnum ("double-s", "Shift Double Click", actionRemove).addValues (reportValues);
|
declareEnum ("double-s", "Shift Double Click", actionRemove).addValues (reportValues);
|
||||||
declareEnum ("double-c", "Control Double Click", actionEditAndRemove).addValues (reportValues);
|
declareEnum ("double-c", "Control Double Click", actionEditAndRemove).addValues (reportValues);
|
||||||
declareEnum ("double-sc", "Shift Control Double Click", actionNone).addValues (reportValues);
|
declareEnum ("double-sc", "Shift Control Double Click", actionNone).addValues (reportValues);
|
||||||
|
declareBool("ignore-base-records", "Ignore base records in verifier", false);
|
||||||
|
|
||||||
declareCategory ("Search & Replace");
|
declareCategory ("Search & Replace");
|
||||||
declareInt ("char-before", "Characters before search string", 10).
|
declareInt ("char-before", "Characters before search string", 10).
|
||||||
|
|
|
@ -5,14 +5,20 @@
|
||||||
|
|
||||||
#include <components/esm/loadbsgn.hpp>
|
#include <components/esm/loadbsgn.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::BirthsignCheckStage::BirthsignCheckStage (const CSMWorld::IdCollection<ESM::BirthSign>& birthsigns)
|
CSMTools::BirthsignCheckStage::BirthsignCheckStage (const CSMWorld::IdCollection<ESM::BirthSign>& birthsigns)
|
||||||
: mBirthsigns (birthsigns)
|
: mBirthsigns (birthsigns)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::BirthsignCheckStage::setup()
|
int CSMTools::BirthsignCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mBirthsigns.getSize();
|
return mBirthsigns.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +26,8 @@ void CSMTools::BirthsignCheckStage::perform (int stage, CSMDoc::Messages& messag
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::BirthSign>& record = mBirthsigns.getRecord (stage);
|
const CSMWorld::Record<ESM::BirthSign>& record = mBirthsigns.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::BirthSign& birthsign = record.get();
|
const ESM::BirthSign& birthsign = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class BirthsignCheckStage : public CSMDoc::Stage
|
class BirthsignCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::BirthSign>& mBirthsigns;
|
const CSMWorld::IdCollection<ESM::BirthSign>& mBirthsigns;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "bodypartcheck.hpp"
|
#include "bodypartcheck.hpp"
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
CSMTools::BodyPartCheckStage::BodyPartCheckStage(
|
CSMTools::BodyPartCheckStage::BodyPartCheckStage(
|
||||||
const CSMWorld::IdCollection<ESM::BodyPart> &bodyParts,
|
const CSMWorld::IdCollection<ESM::BodyPart> &bodyParts,
|
||||||
const CSMWorld::Resources &meshes,
|
const CSMWorld::Resources &meshes,
|
||||||
|
@ -7,10 +9,14 @@ CSMTools::BodyPartCheckStage::BodyPartCheckStage(
|
||||||
mBodyParts(bodyParts),
|
mBodyParts(bodyParts),
|
||||||
mMeshes(meshes),
|
mMeshes(meshes),
|
||||||
mRaces(races)
|
mRaces(races)
|
||||||
{ }
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::BodyPartCheckStage::setup()
|
int CSMTools::BodyPartCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mBodyParts.getSize();
|
return mBodyParts.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +24,8 @@ void CSMTools::BodyPartCheckStage::perform (int stage, CSMDoc::Messages &message
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::BodyPart> &record = mBodyParts.getRecord(stage);
|
const CSMWorld::Record<ESM::BodyPart> &record = mBodyParts.getRecord(stage);
|
||||||
|
|
||||||
if ( record.isDeleted() )
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::BodyPart &bodyPart = record.get();
|
const ESM::BodyPart &bodyPart = record.get();
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace CSMTools
|
||||||
const CSMWorld::IdCollection<ESM::BodyPart> &mBodyParts;
|
const CSMWorld::IdCollection<ESM::BodyPart> &mBodyParts;
|
||||||
const CSMWorld::Resources &mMeshes;
|
const CSMWorld::Resources &mMeshes;
|
||||||
const CSMWorld::IdCollection<ESM::Race> &mRaces;
|
const CSMWorld::IdCollection<ESM::Race> &mRaces;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BodyPartCheckStage(
|
BodyPartCheckStage(
|
||||||
|
|
|
@ -6,14 +6,20 @@
|
||||||
#include <components/esm/loadclas.hpp>
|
#include <components/esm/loadclas.hpp>
|
||||||
#include <components/esm/loadskil.hpp>
|
#include <components/esm/loadskil.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::ClassCheckStage::ClassCheckStage (const CSMWorld::IdCollection<ESM::Class>& classes)
|
CSMTools::ClassCheckStage::ClassCheckStage (const CSMWorld::IdCollection<ESM::Class>& classes)
|
||||||
: mClasses (classes)
|
: mClasses (classes)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::ClassCheckStage::setup()
|
int CSMTools::ClassCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mClasses.getSize();
|
return mClasses.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +27,8 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Class>& record = mClasses.getRecord (stage);
|
const CSMWorld::Record<ESM::Class>& record = mClasses.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Class& class_ = record.get();
|
const ESM::Class& class_ = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class ClassCheckStage : public CSMDoc::Stage
|
class ClassCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Class>& mClasses;
|
const CSMWorld::IdCollection<ESM::Class>& mClasses;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,20 @@
|
||||||
#include <components/esm/loadfact.hpp>
|
#include <components/esm/loadfact.hpp>
|
||||||
#include <components/esm/loadskil.hpp>
|
#include <components/esm/loadskil.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::FactionCheckStage::FactionCheckStage (const CSMWorld::IdCollection<ESM::Faction>& factions)
|
CSMTools::FactionCheckStage::FactionCheckStage (const CSMWorld::IdCollection<ESM::Faction>& factions)
|
||||||
: mFactions (factions)
|
: mFactions (factions)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::FactionCheckStage::setup()
|
int CSMTools::FactionCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mFactions.getSize();
|
return mFactions.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +27,8 @@ void CSMTools::FactionCheckStage::perform (int stage, CSMDoc::Messages& messages
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Faction>& record = mFactions.getRecord (stage);
|
const CSMWorld::Record<ESM::Faction>& record = mFactions.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Faction& faction = record.get();
|
const ESM::Faction& faction = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class FactionCheckStage : public CSMDoc::Stage
|
class FactionCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
|
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,20 @@
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/defaultgmsts.hpp"
|
#include "../world/defaultgmsts.hpp"
|
||||||
|
|
||||||
CSMTools::GmstCheckStage::GmstCheckStage(const CSMWorld::IdCollection<ESM::GameSetting>& gameSettings)
|
CSMTools::GmstCheckStage::GmstCheckStage(const CSMWorld::IdCollection<ESM::GameSetting>& gameSettings)
|
||||||
: mGameSettings(gameSettings)
|
: mGameSettings(gameSettings)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::GmstCheckStage::setup()
|
int CSMTools::GmstCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mGameSettings.getSize();
|
return mGameSettings.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +23,8 @@ void CSMTools::GmstCheckStage::perform(int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::GameSetting>& record = mGameSettings.getRecord (stage);
|
const CSMWorld::Record<ESM::GameSetting>& record = mGameSettings.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::GameSetting& gmst = record.get();
|
const ESM::GameSetting& gmst = record.get();
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace CSMTools
|
||||||
private:
|
private:
|
||||||
|
|
||||||
const CSMWorld::IdCollection<ESM::GameSetting>& mGameSettings;
|
const CSMWorld::IdCollection<ESM::GameSetting>& mGameSettings;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
std::string varTypeToString(ESM::VarType);
|
std::string varTypeToString(ESM::VarType);
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,19 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
CSMTools::JournalCheckStage::JournalCheckStage(const CSMWorld::IdCollection<ESM::Dialogue> &journals,
|
CSMTools::JournalCheckStage::JournalCheckStage(const CSMWorld::IdCollection<ESM::Dialogue> &journals,
|
||||||
const CSMWorld::InfoCollection& journalInfos)
|
const CSMWorld::InfoCollection& journalInfos)
|
||||||
: mJournals(journals), mJournalInfos(journalInfos)
|
: mJournals(journals), mJournalInfos(journalInfos)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::JournalCheckStage::setup()
|
int CSMTools::JournalCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mJournals.getSize();
|
return mJournals.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +23,8 @@ void CSMTools::JournalCheckStage::perform(int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Dialogue> &journalRecord = mJournals.getRecord(stage);
|
const CSMWorld::Record<ESM::Dialogue> &journalRecord = mJournals.getRecord(stage);
|
||||||
|
|
||||||
if (journalRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && journalRecord.isBaseOnly()) || journalRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Dialogue &journal = journalRecord.get();
|
const ESM::Dialogue &journal = journalRecord.get();
|
||||||
|
@ -43,6 +50,10 @@ void CSMTools::JournalCheckStage::perform(int stage, CSMDoc::Messages& messages)
|
||||||
statusNamedCount += 1;
|
statusNamedCount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip "Base" records (setting!)
|
||||||
|
if (mIgnoreBaseRecords && infoRecord.isBaseOnly())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (journalInfo.mResponse.empty())
|
if (journalInfo.mResponse.empty())
|
||||||
{
|
{
|
||||||
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_JournalInfo, journalInfo.mId);
|
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_JournalInfo, journalInfo.mId);
|
||||||
|
|
|
@ -28,6 +28,7 @@ namespace CSMTools
|
||||||
|
|
||||||
const CSMWorld::IdCollection<ESM::Dialogue>& mJournals;
|
const CSMWorld::IdCollection<ESM::Dialogue>& mJournals;
|
||||||
const CSMWorld::InfoCollection& mJournalInfos;
|
const CSMWorld::InfoCollection& mJournalInfos;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <components/misc/resourcehelpers.hpp>
|
#include <components/misc/resourcehelpers.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/resources.hpp"
|
#include "../world/resources.hpp"
|
||||||
#include "../world/data.hpp"
|
#include "../world/data.hpp"
|
||||||
|
|
||||||
|
@ -77,16 +79,26 @@ CSMTools::MagicEffectCheckStage::MagicEffectCheckStage(const CSMWorld::IdCollect
|
||||||
mReferenceables(referenceables),
|
mReferenceables(referenceables),
|
||||||
mIcons(icons),
|
mIcons(icons),
|
||||||
mTextures(textures)
|
mTextures(textures)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::MagicEffectCheckStage::setup()
|
int CSMTools::MagicEffectCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mMagicEffects.getSize();
|
return mMagicEffects.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMTools::MagicEffectCheckStage::perform(int stage, CSMDoc::Messages &messages)
|
void CSMTools::MagicEffectCheckStage::perform(int stage, CSMDoc::Messages &messages)
|
||||||
{
|
{
|
||||||
ESM::MagicEffect effect = mMagicEffects.getRecord(stage).get();
|
const CSMWorld::Record<ESM::MagicEffect> &record = mMagicEffects.getRecord(stage);
|
||||||
|
|
||||||
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
|
return;
|
||||||
|
|
||||||
|
ESM::MagicEffect effect = record.get();
|
||||||
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_MagicEffect, effect.mId);
|
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_MagicEffect, effect.mId);
|
||||||
|
|
||||||
if (effect.mData.mBaseCost < 0.0f)
|
if (effect.mData.mBaseCost < 0.0f)
|
||||||
|
|
|
@ -24,6 +24,7 @@ namespace CSMTools
|
||||||
const CSMWorld::RefIdCollection &mReferenceables;
|
const CSMWorld::RefIdCollection &mReferenceables;
|
||||||
const CSMWorld::Resources &mIcons;
|
const CSMWorld::Resources &mIcons;
|
||||||
const CSMWorld::Resources &mTextures;
|
const CSMWorld::Resources &mTextures;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isTextureExists(const std::string &texture, bool isIcon) const;
|
bool isTextureExists(const std::string &texture, bool isIcon) const;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
#include "../world/idcollection.hpp"
|
#include "../world/idcollection.hpp"
|
||||||
#include "../world/subcellcollection.hpp"
|
#include "../world/subcellcollection.hpp"
|
||||||
|
@ -10,10 +12,14 @@
|
||||||
|
|
||||||
CSMTools::PathgridCheckStage::PathgridCheckStage (const CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& pathgrids)
|
CSMTools::PathgridCheckStage::PathgridCheckStage (const CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& pathgrids)
|
||||||
: mPathgrids (pathgrids)
|
: mPathgrids (pathgrids)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::PathgridCheckStage::setup()
|
int CSMTools::PathgridCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mPathgrids.getSize();
|
return mPathgrids.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +27,8 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<CSMWorld::Pathgrid>& record = mPathgrids.getRecord (stage);
|
const CSMWorld::Record<CSMWorld::Pathgrid>& record = mPathgrids.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CSMWorld::Pathgrid& pathgrid = record.get();
|
const CSMWorld::Pathgrid& pathgrid = record.get();
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace CSMTools
|
||||||
{
|
{
|
||||||
const CSMWorld::SubCellCollection<CSMWorld::Pathgrid,
|
const CSMWorld::SubCellCollection<CSMWorld::Pathgrid,
|
||||||
CSMWorld::IdAccessor<CSMWorld::Pathgrid> >& mPathgrids;
|
CSMWorld::IdAccessor<CSMWorld::Pathgrid> >& mPathgrids;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include <components/esm/loadrace.hpp>
|
#include <components/esm/loadrace.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& messages)
|
void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& messages)
|
||||||
|
@ -15,6 +17,14 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me
|
||||||
|
|
||||||
const ESM::Race& race = record.get();
|
const ESM::Race& race = record.get();
|
||||||
|
|
||||||
|
// Consider mPlayable flag even when "Base" records are ignored
|
||||||
|
if (race.mData.mFlags & 0x1)
|
||||||
|
mPlayable = true;
|
||||||
|
|
||||||
|
// Skip "Base" records (setting!)
|
||||||
|
if (mIgnoreBaseRecords && record.isBaseOnly())
|
||||||
|
return;
|
||||||
|
|
||||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Race, race.mId);
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Race, race.mId);
|
||||||
|
|
||||||
// test for empty name and description
|
// test for empty name and description
|
||||||
|
@ -38,10 +48,6 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me
|
||||||
if (race.mData.mWeight.mFemale<0)
|
if (race.mData.mWeight.mFemale<0)
|
||||||
messages.push_back (std::make_pair (id, "female " + race.mId + " has negative weight"));
|
messages.push_back (std::make_pair (id, "female " + race.mId + " has negative weight"));
|
||||||
|
|
||||||
// remember playable flag
|
|
||||||
if (race.mData.mFlags & 0x1)
|
|
||||||
mPlayable = true;
|
|
||||||
|
|
||||||
/// \todo check data members that can't be edited in the table view
|
/// \todo check data members that can't be edited in the table view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,11 +61,15 @@ void CSMTools::RaceCheckStage::performFinal (CSMDoc::Messages& messages)
|
||||||
|
|
||||||
CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races)
|
CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races)
|
||||||
: mRaces (races), mPlayable (false)
|
: mRaces (races), mPlayable (false)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::RaceCheckStage::setup()
|
int CSMTools::RaceCheckStage::setup()
|
||||||
{
|
{
|
||||||
mPlayable = false;
|
mPlayable = false;
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mRaces.getSize()+1;
|
return mRaces.getSize()+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace CSMTools
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Race>& mRaces;
|
const CSMWorld::IdCollection<ESM::Race>& mRaces;
|
||||||
bool mPlayable;
|
bool mPlayable;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
void performPerRecord (int stage, CSMDoc::Messages& messages);
|
void performPerRecord (int stage, CSMDoc::Messages& messages);
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <components/misc/stringops.hpp>
|
#include <components/misc/stringops.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/record.hpp"
|
#include "../world/record.hpp"
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
|
@ -18,6 +20,7 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(
|
||||||
mScripts(scripts),
|
mScripts(scripts),
|
||||||
mPlayerPresent(false)
|
mPlayerPresent(false)
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMTools::ReferenceableCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
void CSMTools::ReferenceableCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
|
@ -228,6 +231,8 @@ void CSMTools::ReferenceableCheckStage::perform (int stage, CSMDoc::Messages& me
|
||||||
int CSMTools::ReferenceableCheckStage::setup()
|
int CSMTools::ReferenceableCheckStage::setup()
|
||||||
{
|
{
|
||||||
mPlayerPresent = false;
|
mPlayerPresent = false;
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mReferencables.getSize() + 1;
|
return mReferencables.getSize() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +243,8 @@ void CSMTools::ReferenceableCheckStage::bookCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Book& book = (dynamic_cast<const CSMWorld::Record<ESM::Book>& >(baseRecord)).get();
|
const ESM::Book& book = (dynamic_cast<const CSMWorld::Record<ESM::Book>& >(baseRecord)).get();
|
||||||
|
@ -257,7 +263,8 @@ void CSMTools::ReferenceableCheckStage::activatorCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Activator& activator = (dynamic_cast<const CSMWorld::Record<ESM::Activator>& >(baseRecord)).get();
|
const ESM::Activator& activator = (dynamic_cast<const CSMWorld::Record<ESM::Activator>& >(baseRecord)).get();
|
||||||
|
@ -278,7 +285,8 @@ void CSMTools::ReferenceableCheckStage::potionCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Potion& potion = (dynamic_cast<const CSMWorld::Record<ESM::Potion>& >(baseRecord)).get();
|
const ESM::Potion& potion = (dynamic_cast<const CSMWorld::Record<ESM::Potion>& >(baseRecord)).get();
|
||||||
|
@ -299,7 +307,8 @@ void CSMTools::ReferenceableCheckStage::apparatusCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Apparatus& apparatus = (dynamic_cast<const CSMWorld::Record<ESM::Apparatus>& >(baseRecord)).get();
|
const ESM::Apparatus& apparatus = (dynamic_cast<const CSMWorld::Record<ESM::Apparatus>& >(baseRecord)).get();
|
||||||
|
@ -320,7 +329,8 @@ void CSMTools::ReferenceableCheckStage::armorCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Armor& armor = (dynamic_cast<const CSMWorld::Record<ESM::Armor>& >(baseRecord)).get();
|
const ESM::Armor& armor = (dynamic_cast<const CSMWorld::Record<ESM::Armor>& >(baseRecord)).get();
|
||||||
|
@ -347,7 +357,8 @@ void CSMTools::ReferenceableCheckStage::clothingCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Clothing& clothing = (dynamic_cast<const CSMWorld::Record<ESM::Clothing>& >(baseRecord)).get();
|
const ESM::Clothing& clothing = (dynamic_cast<const CSMWorld::Record<ESM::Clothing>& >(baseRecord)).get();
|
||||||
|
@ -365,7 +376,8 @@ void CSMTools::ReferenceableCheckStage::containerCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Container& container = (dynamic_cast<const CSMWorld::Record<ESM::Container>& >(baseRecord)).get();
|
const ESM::Container& container = (dynamic_cast<const CSMWorld::Record<ESM::Container>& >(baseRecord)).get();
|
||||||
|
@ -397,7 +409,8 @@ void CSMTools::ReferenceableCheckStage::creatureCheck (
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Creature& creature = (dynamic_cast<const CSMWorld::Record<ESM::Creature>&>(baseRecord)).get();
|
const ESM::Creature& creature = (dynamic_cast<const CSMWorld::Record<ESM::Creature>&>(baseRecord)).get();
|
||||||
|
@ -473,7 +486,8 @@ void CSMTools::ReferenceableCheckStage::doorCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Door& door = (dynamic_cast<const CSMWorld::Record<ESM::Door>&>(baseRecord)).get();
|
const ESM::Door& door = (dynamic_cast<const CSMWorld::Record<ESM::Door>&>(baseRecord)).get();
|
||||||
|
@ -497,7 +511,8 @@ void CSMTools::ReferenceableCheckStage::ingredientCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Ingredient& ingredient = (dynamic_cast<const CSMWorld::Record<ESM::Ingredient>& >(baseRecord)).get();
|
const ESM::Ingredient& ingredient = (dynamic_cast<const CSMWorld::Record<ESM::Ingredient>& >(baseRecord)).get();
|
||||||
|
@ -516,10 +531,9 @@ void CSMTools::ReferenceableCheckStage::creaturesLevListCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
{
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const ESM::CreatureLevList& CreatureLevList = (dynamic_cast<const CSMWorld::Record<ESM::CreatureLevList>& >(baseRecord)).get();
|
const ESM::CreatureLevList& CreatureLevList = (dynamic_cast<const CSMWorld::Record<ESM::CreatureLevList>& >(baseRecord)).get();
|
||||||
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_CreatureLevelledList, CreatureLevList.mId); //CreatureLevList but Type_CreatureLevelledList :/
|
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_CreatureLevelledList, CreatureLevList.mId); //CreatureLevList but Type_CreatureLevelledList :/
|
||||||
|
@ -534,10 +548,9 @@ void CSMTools::ReferenceableCheckStage::itemLevelledListCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
{
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const ESM::ItemLevList& ItemLevList = (dynamic_cast<const CSMWorld::Record<ESM::ItemLevList>& >(baseRecord)).get();
|
const ESM::ItemLevList& ItemLevList = (dynamic_cast<const CSMWorld::Record<ESM::ItemLevList>& >(baseRecord)).get();
|
||||||
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, ItemLevList.mId);
|
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, ItemLevList.mId);
|
||||||
|
@ -551,7 +564,8 @@ void CSMTools::ReferenceableCheckStage::lightCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Light& light = (dynamic_cast<const CSMWorld::Record<ESM::Light>& >(baseRecord)).get();
|
const ESM::Light& light = (dynamic_cast<const CSMWorld::Record<ESM::Light>& >(baseRecord)).get();
|
||||||
|
@ -574,7 +588,8 @@ void CSMTools::ReferenceableCheckStage::lockpickCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Lockpick& lockpick = (dynamic_cast<const CSMWorld::Record<ESM::Lockpick>& >(baseRecord)).get();
|
const ESM::Lockpick& lockpick = (dynamic_cast<const CSMWorld::Record<ESM::Lockpick>& >(baseRecord)).get();
|
||||||
|
@ -595,7 +610,8 @@ void CSMTools::ReferenceableCheckStage::miscCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Miscellaneous& miscellaneous = (dynamic_cast<const CSMWorld::Record<ESM::Miscellaneous>& >(baseRecord)).get();
|
const ESM::Miscellaneous& miscellaneous = (dynamic_cast<const CSMWorld::Record<ESM::Miscellaneous>& >(baseRecord)).get();
|
||||||
|
@ -619,6 +635,14 @@ void CSMTools::ReferenceableCheckStage::npcCheck (
|
||||||
const ESM::NPC& npc = (dynamic_cast<const CSMWorld::Record<ESM::NPC>& >(baseRecord)).get();
|
const ESM::NPC& npc = (dynamic_cast<const CSMWorld::Record<ESM::NPC>& >(baseRecord)).get();
|
||||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Npc, npc.mId);
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Npc, npc.mId);
|
||||||
|
|
||||||
|
//Detect if player is present
|
||||||
|
if (Misc::StringUtils::ciEqual(npc.mId, "player")) //Happy now, scrawl?
|
||||||
|
mPlayerPresent = true;
|
||||||
|
|
||||||
|
// Skip "Base" records (setting!)
|
||||||
|
if (mIgnoreBaseRecords && baseRecord.isBaseOnly())
|
||||||
|
return;
|
||||||
|
|
||||||
short level(npc.mNpdt.mLevel);
|
short level(npc.mNpdt.mLevel);
|
||||||
char disposition(npc.mNpdt.mDisposition);
|
char disposition(npc.mNpdt.mDisposition);
|
||||||
char reputation(npc.mNpdt.mReputation);
|
char reputation(npc.mNpdt.mReputation);
|
||||||
|
@ -626,10 +650,6 @@ void CSMTools::ReferenceableCheckStage::npcCheck (
|
||||||
//Don't know what unknown is for
|
//Don't know what unknown is for
|
||||||
int gold(npc.mNpdt.mGold);
|
int gold(npc.mNpdt.mGold);
|
||||||
|
|
||||||
//Detect if player is present
|
|
||||||
if (Misc::StringUtils::ciEqual(npc.mId, "player")) //Happy now, scrawl?
|
|
||||||
mPlayerPresent = true;
|
|
||||||
|
|
||||||
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS) //12 = autocalculated
|
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS) //12 = autocalculated
|
||||||
{
|
{
|
||||||
if ((npc.mFlags & ESM::NPC::Autocalc) == 0) //0x0010 = autocalculated flag
|
if ((npc.mFlags & ESM::NPC::Autocalc) == 0) //0x0010 = autocalculated flag
|
||||||
|
@ -728,7 +748,8 @@ void CSMTools::ReferenceableCheckStage::weaponCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord (stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord (stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Weapon& weapon = (dynamic_cast<const CSMWorld::Record<ESM::Weapon>& >(baseRecord)).get();
|
const ESM::Weapon& weapon = (dynamic_cast<const CSMWorld::Record<ESM::Weapon>& >(baseRecord)).get();
|
||||||
|
@ -808,7 +829,8 @@ void CSMTools::ReferenceableCheckStage::probeCheck(
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord(stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Probe& probe = (dynamic_cast<const CSMWorld::Record<ESM::Probe>& >(baseRecord)).get();
|
const ESM::Probe& probe = (dynamic_cast<const CSMWorld::Record<ESM::Probe>& >(baseRecord)).get();
|
||||||
|
@ -827,7 +849,8 @@ void CSMTools::ReferenceableCheckStage::repairCheck (
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord (stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord (stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Repair& repair = (dynamic_cast<const CSMWorld::Record<ESM::Repair>& >(baseRecord)).get();
|
const ESM::Repair& repair = (dynamic_cast<const CSMWorld::Record<ESM::Repair>& >(baseRecord)).get();
|
||||||
|
@ -846,7 +869,8 @@ void CSMTools::ReferenceableCheckStage::staticCheck (
|
||||||
{
|
{
|
||||||
const CSMWorld::RecordBase& baseRecord = records.getRecord (stage);
|
const CSMWorld::RecordBase& baseRecord = records.getRecord (stage);
|
||||||
|
|
||||||
if (baseRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && baseRecord.isBaseOnly()) || baseRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Static& staticElement = (dynamic_cast<const CSMWorld::Record<ESM::Static>& >(baseRecord)).get();
|
const ESM::Static& staticElement = (dynamic_cast<const CSMWorld::Record<ESM::Static>& >(baseRecord)).get();
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace CSMTools
|
||||||
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
|
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
|
||||||
const CSMWorld::IdCollection<ESM::Script>& mScripts;
|
const CSMWorld::IdCollection<ESM::Script>& mScripts;
|
||||||
bool mPlayerPresent;
|
bool mPlayerPresent;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // REFERENCEABLECHECKSTAGE_H
|
#endif // REFERENCEABLECHECKSTAGE_H
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "referencecheck.hpp"
|
#include "referencecheck.hpp"
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
CSMTools::ReferenceCheckStage::ReferenceCheckStage(
|
CSMTools::ReferenceCheckStage::ReferenceCheckStage(
|
||||||
const CSMWorld::RefCollection& references,
|
const CSMWorld::RefCollection& references,
|
||||||
const CSMWorld::RefIdCollection& referencables,
|
const CSMWorld::RefIdCollection& referencables,
|
||||||
|
@ -12,13 +14,15 @@ CSMTools::ReferenceCheckStage::ReferenceCheckStage(
|
||||||
mCells(cells),
|
mCells(cells),
|
||||||
mFactions(factions)
|
mFactions(factions)
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &messages)
|
void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<CSMWorld::CellRef>& record = mReferences.getRecord(stage);
|
const CSMWorld::Record<CSMWorld::CellRef>& record = mReferences.getRecord(stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CSMWorld::CellRef& cellRef = record.get();
|
const CSMWorld::CellRef& cellRef = record.get();
|
||||||
|
@ -100,5 +104,7 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages &message
|
||||||
|
|
||||||
int CSMTools::ReferenceCheckStage::setup()
|
int CSMTools::ReferenceCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mReferences.getSize();
|
return mReferences.getSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace CSMTools
|
||||||
const CSMWorld::RefIdData& mDataSet;
|
const CSMWorld::RefIdData& mDataSet;
|
||||||
const CSMWorld::IdCollection<CSMWorld::Cell>& mCells;
|
const CSMWorld::IdCollection<CSMWorld::Cell>& mCells;
|
||||||
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
|
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,20 @@
|
||||||
|
|
||||||
#include <components/esm/loadregn.hpp>
|
#include <components/esm/loadregn.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::RegionCheckStage::RegionCheckStage (const CSMWorld::IdCollection<ESM::Region>& regions)
|
CSMTools::RegionCheckStage::RegionCheckStage (const CSMWorld::IdCollection<ESM::Region>& regions)
|
||||||
: mRegions (regions)
|
: mRegions (regions)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::RegionCheckStage::setup()
|
int CSMTools::RegionCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mRegions.getSize();
|
return mRegions.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +26,8 @@ void CSMTools::RegionCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Region>& record = mRegions.getRecord (stage);
|
const CSMWorld::Record<ESM::Region>& record = mRegions.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Region& region = record.get();
|
const ESM::Region& region = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class RegionCheckStage : public CSMDoc::Stage
|
class RegionCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Region>& mRegions;
|
const CSMWorld::IdCollection<ESM::Region>& mRegions;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,8 @@ CSMTools::ScriptCheckStage::ScriptCheckStage (const CSMDoc::Document& document)
|
||||||
|
|
||||||
Compiler::registerExtensions (mExtensions);
|
Compiler::registerExtensions (mExtensions);
|
||||||
mContext.setExtensions (&mExtensions);
|
mContext.setExtensions (&mExtensions);
|
||||||
|
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSMTools::ScriptCheckStage::setup()
|
int CSMTools::ScriptCheckStage::setup()
|
||||||
|
@ -78,17 +80,25 @@ int CSMTools::ScriptCheckStage::setup()
|
||||||
mId.clear();
|
mId.clear();
|
||||||
Compiler::ErrorHandler::reset();
|
Compiler::ErrorHandler::reset();
|
||||||
|
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mDocument.getData().getScripts().getSize();
|
return mDocument.getData().getScripts().getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
|
const CSMWorld::Record<ESM::Script> &record = mDocument.getData().getScripts().getRecord(stage);
|
||||||
|
|
||||||
mId = mDocument.getData().getScripts().getId (stage);
|
mId = mDocument.getData().getScripts().getId (stage);
|
||||||
|
|
||||||
if (mDocument.isBlacklisted (
|
if (mDocument.isBlacklisted (
|
||||||
CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Script, mId)))
|
CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Script, mId)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
|
return;
|
||||||
|
|
||||||
mMessages = &messages;
|
mMessages = &messages;
|
||||||
|
|
||||||
switch (mWarningMode)
|
switch (mWarningMode)
|
||||||
|
@ -100,10 +110,8 @@ void CSMTools::ScriptCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const CSMWorld::Data& data = mDocument.getData();
|
mFile = record.get().mId;
|
||||||
|
std::istringstream input (record.get().mScriptText);
|
||||||
mFile = data.getScripts().getRecord (stage).get().mId;
|
|
||||||
std::istringstream input (data.getScripts().getRecord (stage).get().mScriptText);
|
|
||||||
|
|
||||||
Compiler::Scanner scanner (*this, input, mContext.getExtensions());
|
Compiler::Scanner scanner (*this, input, mContext.getExtensions());
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace CSMTools
|
||||||
std::string mFile;
|
std::string mFile;
|
||||||
CSMDoc::Messages *mMessages;
|
CSMDoc::Messages *mMessages;
|
||||||
WarningMode mWarningMode;
|
WarningMode mWarningMode;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
CSMDoc::Message::Severity getSeverity (Type type);
|
CSMDoc::Message::Severity getSeverity (Type type);
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,20 @@
|
||||||
|
|
||||||
#include <components/esm/loadskil.hpp>
|
#include <components/esm/loadskil.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::SkillCheckStage::SkillCheckStage (const CSMWorld::IdCollection<ESM::Skill>& skills)
|
CSMTools::SkillCheckStage::SkillCheckStage (const CSMWorld::IdCollection<ESM::Skill>& skills)
|
||||||
: mSkills (skills)
|
: mSkills (skills)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::SkillCheckStage::setup()
|
int CSMTools::SkillCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mSkills.getSize();
|
return mSkills.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +25,8 @@ void CSMTools::SkillCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Skill>& record = mSkills.getRecord (stage);
|
const CSMWorld::Record<ESM::Skill>& record = mSkills.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Skill& skill = record.get();
|
const ESM::Skill& skill = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class SkillCheckStage : public CSMDoc::Stage
|
class SkillCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Skill>& mSkills;
|
const CSMWorld::IdCollection<ESM::Skill>& mSkills;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,20 @@
|
||||||
|
|
||||||
#include <components/esm/loadskil.hpp>
|
#include <components/esm/loadskil.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds)
|
CSMTools::SoundCheckStage::SoundCheckStage (const CSMWorld::IdCollection<ESM::Sound>& sounds)
|
||||||
: mSounds (sounds)
|
: mSounds (sounds)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::SoundCheckStage::setup()
|
int CSMTools::SoundCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mSounds.getSize();
|
return mSounds.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +25,8 @@ void CSMTools::SoundCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Sound>& record = mSounds.getRecord (stage);
|
const CSMWorld::Record<ESM::Sound>& record = mSounds.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Sound& sound = record.get();
|
const ESM::Sound& sound = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class SoundCheckStage : public CSMDoc::Stage
|
class SoundCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Sound>& mSounds;
|
const CSMWorld::IdCollection<ESM::Sound>& mSounds;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/refiddata.hpp"
|
#include "../world/refiddata.hpp"
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
|
@ -11,20 +13,24 @@ CSMTools::SoundGenCheckStage::SoundGenCheckStage(const CSMWorld::IdCollection<ES
|
||||||
: mSoundGens(soundGens),
|
: mSoundGens(soundGens),
|
||||||
mSounds(sounds),
|
mSounds(sounds),
|
||||||
mReferenceables(referenceables)
|
mReferenceables(referenceables)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::SoundGenCheckStage::setup()
|
int CSMTools::SoundGenCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mSoundGens.getSize();
|
return mSoundGens.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMTools::SoundGenCheckStage::perform(int stage, CSMDoc::Messages &messages)
|
void CSMTools::SoundGenCheckStage::perform(int stage, CSMDoc::Messages &messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::SoundGenerator> &record = mSoundGens.getRecord(stage);
|
const CSMWorld::Record<ESM::SoundGenerator> &record = mSoundGens.getRecord(stage);
|
||||||
if (record.isDeleted())
|
|
||||||
{
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
const ESM::SoundGenerator& soundGen = record.get();
|
const ESM::SoundGenerator& soundGen = record.get();
|
||||||
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_SoundGen, soundGen.mId);
|
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_SoundGen, soundGen.mId);
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
const CSMWorld::IdCollection<ESM::SoundGenerator> &mSoundGens;
|
const CSMWorld::IdCollection<ESM::SoundGenerator> &mSoundGens;
|
||||||
const CSMWorld::IdCollection<ESM::Sound> &mSounds;
|
const CSMWorld::IdCollection<ESM::Sound> &mSounds;
|
||||||
const CSMWorld::RefIdCollection &mReferenceables;
|
const CSMWorld::RefIdCollection &mReferenceables;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SoundGenCheckStage(const CSMWorld::IdCollection<ESM::SoundGenerator> &soundGens,
|
SoundGenCheckStage(const CSMWorld::IdCollection<ESM::SoundGenerator> &soundGens,
|
||||||
|
|
|
@ -5,14 +5,20 @@
|
||||||
|
|
||||||
#include <components/esm/loadspel.hpp>
|
#include <components/esm/loadspel.hpp>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::SpellCheckStage::SpellCheckStage (const CSMWorld::IdCollection<ESM::Spell>& spells)
|
CSMTools::SpellCheckStage::SpellCheckStage (const CSMWorld::IdCollection<ESM::Spell>& spells)
|
||||||
: mSpells (spells)
|
: mSpells (spells)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::SpellCheckStage::setup()
|
int CSMTools::SpellCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mSpells.getSize();
|
return mSpells.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +26,8 @@ void CSMTools::SpellCheckStage::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::Spell>& record = mSpells.getRecord (stage);
|
const CSMWorld::Record<ESM::Spell>& record = mSpells.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ESM::Spell& spell = record.get();
|
const ESM::Spell& spell = record.get();
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace CSMTools
|
||||||
class SpellCheckStage : public CSMDoc::Stage
|
class SpellCheckStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Spell>& mSpells;
|
const CSMWorld::IdCollection<ESM::Spell>& mSpells;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
#include "startscriptcheck.hpp"
|
#include "startscriptcheck.hpp"
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include <components/misc/stringops.hpp>
|
#include <components/misc/stringops.hpp>
|
||||||
|
|
||||||
CSMTools::StartScriptCheckStage::StartScriptCheckStage (
|
CSMTools::StartScriptCheckStage::StartScriptCheckStage (
|
||||||
const CSMWorld::IdCollection<ESM::StartScript>& startScripts,
|
const CSMWorld::IdCollection<ESM::StartScript>& startScripts,
|
||||||
const CSMWorld::IdCollection<ESM::Script>& scripts)
|
const CSMWorld::IdCollection<ESM::Script>& scripts)
|
||||||
: mStartScripts (startScripts), mScripts (scripts)
|
: mStartScripts (startScripts), mScripts (scripts)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messages)
|
void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<ESM::StartScript>& record = mStartScripts.getRecord (stage);
|
const CSMWorld::Record<ESM::StartScript>& record = mStartScripts.getRecord (stage);
|
||||||
|
|
||||||
if (record.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && record.isBaseOnly()) || record.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string scriptId = record.get().mId;
|
std::string scriptId = record.get().mId;
|
||||||
|
@ -26,5 +31,7 @@ void CSMTools::StartScriptCheckStage::perform(int stage, CSMDoc::Messages& messa
|
||||||
|
|
||||||
int CSMTools::StartScriptCheckStage::setup()
|
int CSMTools::StartScriptCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mStartScripts.getSize();
|
return mStartScripts.getSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace CSMTools
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::StartScript>& mStartScripts;
|
const CSMWorld::IdCollection<ESM::StartScript>& mStartScripts;
|
||||||
const CSMWorld::IdCollection<ESM::Script>& mScripts;
|
const CSMWorld::IdCollection<ESM::Script>& mScripts;
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
#include "../prefs/state.hpp"
|
||||||
|
|
||||||
#include "../world/infoselectwrapper.hpp"
|
#include "../world/infoselectwrapper.hpp"
|
||||||
|
|
||||||
CSMTools::TopicInfoCheckStage::TopicInfoCheckStage(
|
CSMTools::TopicInfoCheckStage::TopicInfoCheckStage(
|
||||||
|
@ -29,7 +31,9 @@ CSMTools::TopicInfoCheckStage::TopicInfoCheckStage(
|
||||||
mTopics(topics),
|
mTopics(topics),
|
||||||
mReferencables(referencables),
|
mReferencables(referencables),
|
||||||
mSoundFiles(soundFiles)
|
mSoundFiles(soundFiles)
|
||||||
{}
|
{
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
int CSMTools::TopicInfoCheckStage::setup()
|
int CSMTools::TopicInfoCheckStage::setup()
|
||||||
{
|
{
|
||||||
|
@ -67,6 +71,8 @@ int CSMTools::TopicInfoCheckStage::setup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mIgnoreBaseRecords = CSMPrefs::get()["Reports"]["ignore-base-records"].isTrue();
|
||||||
|
|
||||||
return mTopicInfos.getSize();
|
return mTopicInfos.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +80,8 @@ void CSMTools::TopicInfoCheckStage::perform(int stage, CSMDoc::Messages& message
|
||||||
{
|
{
|
||||||
const CSMWorld::Record<CSMWorld::Info>& infoRecord = mTopicInfos.getRecord(stage);
|
const CSMWorld::Record<CSMWorld::Info>& infoRecord = mTopicInfos.getRecord(stage);
|
||||||
|
|
||||||
if (infoRecord.isDeleted())
|
// Skip "Base" records (setting!) and "Deleted" records
|
||||||
|
if ((mIgnoreBaseRecords && infoRecord.isBaseOnly()) || infoRecord.isDeleted())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const CSMWorld::Info& topicInfo = infoRecord.get();
|
const CSMWorld::Info& topicInfo = infoRecord.get();
|
||||||
|
|
|
@ -65,6 +65,8 @@ namespace CSMTools
|
||||||
|
|
||||||
std::set<std::string> mCellNames;
|
std::set<std::string> mCellNames;
|
||||||
|
|
||||||
|
bool mIgnoreBaseRecords;
|
||||||
|
|
||||||
// These return false when not successful and write an error
|
// These return false when not successful and write an error
|
||||||
bool verifyActor(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages);
|
bool verifyActor(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages);
|
||||||
bool verifyCell(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages);
|
bool verifyCell(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages);
|
||||||
|
|
|
@ -2,6 +2,11 @@
|
||||||
|
|
||||||
CSMWorld::RecordBase::~RecordBase() {}
|
CSMWorld::RecordBase::~RecordBase() {}
|
||||||
|
|
||||||
|
bool CSMWorld::RecordBase::isBaseOnly() const
|
||||||
|
{
|
||||||
|
return mState == State_BaseOnly;
|
||||||
|
}
|
||||||
|
|
||||||
bool CSMWorld::RecordBase::isDeleted() const
|
bool CSMWorld::RecordBase::isDeleted() const
|
||||||
{
|
{
|
||||||
return mState==State_Deleted || mState==State_Erased;
|
return mState==State_Deleted || mState==State_Erased;
|
||||||
|
|
|
@ -27,6 +27,8 @@ namespace CSMWorld
|
||||||
virtual void assign (const RecordBase& record) = 0;
|
virtual void assign (const RecordBase& record) = 0;
|
||||||
///< Will throw an exception if the types don't match.
|
///< Will throw an exception if the types don't match.
|
||||||
|
|
||||||
|
bool isBaseOnly() const;
|
||||||
|
|
||||||
bool isDeleted() const;
|
bool isDeleted() const;
|
||||||
|
|
||||||
bool isErased() const;
|
bool isErased() const;
|
||||||
|
|
Loading…
Reference in a new issue