mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-02 02:11:32 +00:00
Merge branch 'shutupverifier' into 'master'
Editor: Silence some verifier warnings See merge request OpenMW/openmw!3814
This commit is contained in:
commit
f656d2e380
4 changed files with 12 additions and 14 deletions
|
@ -691,15 +691,6 @@ void CSMTools::ReferenceableCheckStage::npcCheck(
|
||||||
return;
|
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)
|
if (level <= 0)
|
||||||
messages.add(id, "Level is non-positive", "", CSMDoc::Message::Severity_Warning);
|
messages.add(id, "Level is non-positive", "", CSMDoc::Message::Severity_Warning);
|
||||||
|
|
|
@ -18,16 +18,18 @@
|
||||||
#include <apps/opencs/model/world/universalid.hpp>
|
#include <apps/opencs/model/world/universalid.hpp>
|
||||||
|
|
||||||
#include <components/esm3/cellref.hpp>
|
#include <components/esm3/cellref.hpp>
|
||||||
|
#include <components/esm3/loadbody.hpp>
|
||||||
#include <components/esm3/loadfact.hpp>
|
#include <components/esm3/loadfact.hpp>
|
||||||
|
|
||||||
CSMTools::ReferenceCheckStage::ReferenceCheckStage(const CSMWorld::RefCollection& references,
|
CSMTools::ReferenceCheckStage::ReferenceCheckStage(const CSMWorld::RefCollection& references,
|
||||||
const CSMWorld::RefIdCollection& referencables, const CSMWorld::IdCollection<CSMWorld::Cell>& cells,
|
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)
|
: mReferences(references)
|
||||||
, mObjects(referencables)
|
, mObjects(referencables)
|
||||||
, mDataSet(referencables.getDataSet())
|
, mDataSet(referencables.getDataSet())
|
||||||
, mCells(cells)
|
, mCells(cells)
|
||||||
, mFactions(factions)
|
, mFactions(factions)
|
||||||
|
, mBodyParts(bodyparts)
|
||||||
{
|
{
|
||||||
mIgnoreBaseRecords = false;
|
mIgnoreBaseRecords = false;
|
||||||
}
|
}
|
||||||
|
@ -49,9 +51,11 @@ void CSMTools::ReferenceCheckStage::perform(int stage, CSMDoc::Messages& message
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Check for non existing referenced object
|
// 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() + "'", "",
|
messages.add(id, "Instance of a non-existent object '" + cellRef.mRefID.getRefIdString() + "'", "",
|
||||||
CSMDoc::Message::Severity_Error);
|
CSMDoc::Message::Severity_Error);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Check if reference charge is valid for it's proper referenced type
|
// Check if reference charge is valid for it's proper referenced type
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
namespace ESM
|
namespace ESM
|
||||||
{
|
{
|
||||||
|
struct BodyPart;
|
||||||
struct Faction;
|
struct Faction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +30,8 @@ namespace CSMTools
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ReferenceCheckStage(const CSMWorld::RefCollection& references, const CSMWorld::RefIdCollection& referencables,
|
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;
|
void perform(int stage, CSMDoc::Messages& messages) override;
|
||||||
int setup() override;
|
int setup() override;
|
||||||
|
@ -40,6 +42,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;
|
||||||
|
const CSMWorld::IdCollection<ESM::BodyPart>& mBodyParts;
|
||||||
bool mIgnoreBaseRecords;
|
bool mIgnoreBaseRecords;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,8 +105,8 @@ CSMDoc::OperationHolder* CSMTools::Tools::getVerifier()
|
||||||
mData.getFactions(), mData.getScripts(), mData.getResources(CSMWorld::UniversalId::Type_Meshes),
|
mData.getFactions(), mData.getScripts(), mData.getResources(CSMWorld::UniversalId::Type_Meshes),
|
||||||
mData.getResources(CSMWorld::UniversalId::Type_Icons), mData.getBodyParts()));
|
mData.getResources(CSMWorld::UniversalId::Type_Icons), mData.getBodyParts()));
|
||||||
|
|
||||||
mVerifierOperation->appendStage(new ReferenceCheckStage(
|
mVerifierOperation->appendStage(new ReferenceCheckStage(mData.getReferences(), mData.getReferenceables(),
|
||||||
mData.getReferences(), mData.getReferenceables(), mData.getCells(), mData.getFactions()));
|
mData.getCells(), mData.getFactions(), mData.getBodyParts()));
|
||||||
|
|
||||||
mVerifierOperation->appendStage(new ScriptCheckStage(mDocument));
|
mVerifierOperation->appendStage(new ScriptCheckStage(mDocument));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue