Commit d1b2fc11 authored by Capostrophic's avatar Capostrophic

Use messages::add in object record verifiers

Add NPC head and hair body part existence checks and expand creature record verifier, update playable class checks in class record verifier
parent 85dc1e4e
......@@ -36,7 +36,12 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
// A class should have a name
if (class_.mName.empty())
messages.add(id, "Name is missing", "", CSMDoc::Message::Severity_Warning);
{
if (class_.mData.mIsPlayable != 0)
messages.add(id, "Name of a playable class is missing", "", CSMDoc::Message::Severity_Error);
else
messages.add(id, "Name is missing", "", CSMDoc::Message::Severity_Warning);
}
// A playable class should have a description
if (class_.mData.mIsPlayable != 0 && class_.mDescription.empty())
......
......@@ -19,7 +19,8 @@ namespace CSMTools
const CSMWorld::IdCollection<ESM::Faction>& factions,
const CSMWorld::IdCollection<ESM::Script>& scripts,
const CSMWorld::Resources& models,
const CSMWorld::Resources& icons);
const CSMWorld::Resources& icons,
const CSMWorld::IdCollection<ESM::BodyPart>& bodyparts);
virtual void perform(int stage, CSMDoc::Messages& messages);
virtual int setup();
......@@ -86,6 +87,7 @@ namespace CSMTools
const CSMWorld::IdCollection<ESM::Script>& mScripts;
const CSMWorld::Resources& mModels;
const CSMWorld::Resources& mIcons;
const CSMWorld::IdCollection<ESM::BodyPart>& mBodyParts;
bool mPlayerPresent;
bool mIgnoreBaseRecords;
};
......
......@@ -83,7 +83,8 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier()
mVerifierOperation->appendStage (new SpellCheckStage (mData.getSpells()));
mVerifierOperation->appendStage (new ReferenceableCheckStage (mData.getReferenceables().getDataSet(), mData.getRaces(), mData.getClasses(), mData.getFactions(), mData.getScripts(),
mData.getResources (CSMWorld::UniversalId::Type_Meshes), mData.getResources (CSMWorld::UniversalId::Type_Icons)));
mData.getResources (CSMWorld::UniversalId::Type_Meshes), mData.getResources (CSMWorld::UniversalId::Type_Icons),
mData.getBodyParts()));
mVerifierOperation->appendStage (new ReferenceCheckStage(mData.getReferences(), mData.getReferenceables(), mData.getCells(), mData.getFactions()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment