1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Changes according to the comment.

This commit is contained in:
Marek Kochanowicz 2014-01-06 23:37:18 +01:00
parent 06f8537087
commit b85fe2becf

View File

@ -1,6 +1,7 @@
#include "referenceablecheck.hpp" #include "referenceablecheck.hpp"
#include "../world/record.hpp" #include "../world/record.hpp"
#include "../world/universalid.hpp" #include "../world/universalid.hpp"
#include <iostream>
CSMTools::ReferenceableCheckStage::ReferenceableCheckStage( CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(
const CSMWorld::RefIdData& referenceable, const CSMWorld::IdCollection<ESM::Race >& races, const CSMWorld::RefIdData& referenceable, const CSMWorld::IdCollection<ESM::Race >& races,
@ -17,11 +18,6 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(
void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::string >& messages) void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::string >& messages)
{ {
if (stage == mReferencables.getSize() - 1)
{
finalCheck(messages);
}
//Checks for books, than, when stage is above mBooksSize goes to other checks, with (stage - PrevSum) as stage. //Checks for books, than, when stage is above mBooksSize goes to other checks, with (stage - PrevSum) as stage.
const int bookSize(mReferencables.getBooks().getSize()); const int bookSize(mReferencables.getBooks().getSize());
@ -102,6 +98,7 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
} }
stage -= doorSize; stage -= doorSize;
const int ingredientSize(mReferencables.getIngredients().getSize()); const int ingredientSize(mReferencables.getIngredients().getSize());
if (stage < ingredientSize) if (stage < ingredientSize)
@ -209,11 +206,15 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
staticCheck(stage, mReferencables.getStatics(), messages); staticCheck(stage, mReferencables.getStatics(), messages);
return; return;
} }
// if we come that far, we are about to perform our last, final check.
finalCheck(messages);
return;
} }
int CSMTools::ReferenceableCheckStage::setup() int CSMTools::ReferenceableCheckStage::setup()
{ {
return mReferencables.getSize(); mPlayerPresent = false;
return mReferencables.getSize() + 1;
} }
void CSMTools::ReferenceableCheckStage::bookCheck( void CSMTools::ReferenceableCheckStage::bookCheck(
@ -965,8 +966,6 @@ void CSMTools::ReferenceableCheckStage::finalCheck(std::vector< std::string >& m
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_Npc); CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_Npc);
messages.push_back(id.toString() + "| There is no player record"); messages.push_back(id.toString() + "| There is no player record");
} }
mPlayerPresent = false;
} }