From c89608f390c1d82a749aef448240481bc80afaff Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 30 Dec 2013 11:39:03 +0100 Subject: [PATCH] Check for head and hair. Correct faction check. --- .../opencs/model/tools/referenceablecheck.cpp | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index d2053c1a6b..ad52c59621 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -995,30 +995,38 @@ void CSMTools::ReferenceableCheckStage::npcCheck(int stage, const CSMWorld::RefI messages.push_back(id.toString() + "|" + NPC.mId + " has negative reputation"); } - if (!NPC.mFaction.empty()) + if (NPC.mFaction.empty() == false) { if (Rank < 0) { messages.push_back(id.toString() + "|" + NPC.mId + " has negative rank"); } - //This code does not work at the moment. nosuchfaction is true for every npc record - /* - bool nosuchfaction(true); - for (int i = 0; i < mRaces.getSize(); ++i) - { - if (dynamic_cast(mFactions.getRecord(i).get()).mName == NPC.mFaction) - { - nosuchfaction = false; - break; - } - } + bool nosuchfaction(true); - if (nosuchfaction) - { - messages.push_back(id.toString() + "|" + NPC.mId + " has invalid faction"); - } - */ + for (int i = 0; i < mFactions.getSize(); ++i) + { + if (dynamic_cast(mFactions.getRecord(i).get()).mId == NPC.mFaction) + { + nosuchfaction = false; + break; + } + } + + if (nosuchfaction) + { + messages.push_back(id.toString() + "|" + NPC.mId + " has invalid faction"); + } + } + + if (NPC.mHead.empty()) + { + messages.push_back(id.toString() + "|" + NPC.mId + " has no head"); + } + + if (NPC.mHair.empty()) + { + messages.push_back(id.toString() + "|" + NPC.mId + " has no har"); } //TODO: reputation, Disposition, rank, everything else