diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index d25568fd0a..a692bc10d1 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -691,15 +691,6 @@ void CSMTools::ReferenceableCheckStage::npcCheck( return; } } - else if (npc.mNpdt.mHealth != 0) - { - for (size_t i = 0; i < npc.mNpdt.mAttributes.size(); ++i) - { - if (npc.mNpdt.mAttributes[i] == 0) - messages.add(id, ESM::Attribute::indexToRefId(i).getRefIdString() + " is equal to zero", {}, - CSMDoc::Message::Severity_Warning); - } - } if (level <= 0) messages.add(id, "Level is non-positive", "", CSMDoc::Message::Severity_Warning); diff --git a/apps/opencs/model/tools/referencecheck.cpp b/apps/opencs/model/tools/referencecheck.cpp index 511458b946..33c2168ef3 100644 --- a/apps/opencs/model/tools/referencecheck.cpp +++ b/apps/opencs/model/tools/referencecheck.cpp @@ -18,16 +18,18 @@ #include #include +#include #include CSMTools::ReferenceCheckStage::ReferenceCheckStage(const CSMWorld::RefCollection& references, const CSMWorld::RefIdCollection& referencables, const CSMWorld::IdCollection& cells, - const CSMWorld::IdCollection& factions) + const CSMWorld::IdCollection& factions, const CSMWorld::IdCollection& bodyparts) : mReferences(references) , mObjects(referencables) , mDataSet(referencables.getDataSet()) , mCells(cells) , mFactions(factions) + , mBodyParts(bodyparts) { mIgnoreBaseRecords = false; } @@ -49,9 +51,11 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages& message else { // Check for non existing referenced object - if (mObjects.searchId(cellRef.mRefID) == -1) + if (mObjects.searchId(cellRef.mRefID) == -1 && mBodyParts.searchId(cellRef.mRefID) == -1) + { messages.add(id, "Instance of a non-existent object '" + cellRef.mRefID.getRefIdString() + "'", "", CSMDoc::Message::Severity_Error); + } else { // Check if reference charge is valid for it's proper referenced type diff --git a/apps/opencs/model/tools/referencecheck.hpp b/apps/opencs/model/tools/referencecheck.hpp index 04cca2b803..5f5004b912 100644 --- a/apps/opencs/model/tools/referencecheck.hpp +++ b/apps/opencs/model/tools/referencecheck.hpp @@ -8,6 +8,7 @@ namespace ESM { + struct BodyPart; struct Faction; } @@ -29,7 +30,8 @@ namespace CSMTools { public: ReferenceCheckStage(const CSMWorld::RefCollection& references, const CSMWorld::RefIdCollection& referencables, - const CSMWorld::IdCollection& cells, const CSMWorld::IdCollection& factions); + const CSMWorld::IdCollection& cells, const CSMWorld::IdCollection& factions, + const CSMWorld::IdCollection& bodyparts); void perform(int stage, CSMDoc::Messages& messages) override; int setup() override; @@ -40,6 +42,7 @@ namespace CSMTools const CSMWorld::RefIdData& mDataSet; const CSMWorld::IdCollection& mCells; const CSMWorld::IdCollection& mFactions; + const CSMWorld::IdCollection& mBodyParts; bool mIgnoreBaseRecords; }; } diff --git a/apps/opencs/model/tools/tools.cpp b/apps/opencs/model/tools/tools.cpp index e1e7a0dcd8..04548ca4cf 100644 --- a/apps/opencs/model/tools/tools.cpp +++ b/apps/opencs/model/tools/tools.cpp @@ -105,8 +105,8 @@ CSMDoc::OperationHolder* CSMTools::Tools::getVerifier() mData.getFactions(), mData.getScripts(), 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())); + mVerifierOperation->appendStage(new ReferenceCheckStage(mData.getReferences(), mData.getReferenceables(), + mData.getCells(), mData.getFactions(), mData.getBodyParts())); mVerifierOperation->appendStage(new ScriptCheckStage(mDocument));