mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Editor: Don't complain about body part references in Verify
This commit is contained in:
parent
cdf2459ed8
commit
48bbf0b637
@ -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…
x
Reference in New Issue
Block a user