Merge branch 'shutupverifier' into 'master'

Editor: Silence some verifier warnings

See merge request OpenMW/openmw!3814
ini_importer_tests
psi29a 11 months ago
commit f656d2e380

@ -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);

@ -18,16 +18,18 @@
#include <apps/opencs/model/world/universalid.hpp>
#include <components/esm3/cellref.hpp>
#include <components/esm3/loadbody.hpp>
#include <components/esm3/loadfact.hpp>
CSMTools::ReferenceCheckStage::ReferenceCheckStage(const CSMWorld::RefCollection& references,
const CSMWorld::RefIdCollection& referencables, const CSMWorld::IdCollection<CSMWorld::Cell>& cells,
const CSMWorld::IdCollection<ESM::Faction>& factions)
const CSMWorld::IdCollection<ESM::Faction>& factions, const CSMWorld::IdCollection<ESM::BodyPart>& 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

@ -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<CSMWorld::Cell>& cells, const CSMWorld::IdCollection<ESM::Faction>& factions);
const CSMWorld::IdCollection<CSMWorld::Cell>& cells, const CSMWorld::IdCollection<ESM::Faction>& factions,
const CSMWorld::IdCollection<ESM::BodyPart>& 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<CSMWorld::Cell>& mCells;
const CSMWorld::IdCollection<ESM::Faction>& mFactions;
const CSMWorld::IdCollection<ESM::BodyPart>& mBodyParts;
bool mIgnoreBaseRecords;
};
}

@ -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));

Loading…
Cancel
Save