diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index e2091de2e2..d37808810e 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -10,36 +10,20 @@ CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(const CSMWorld::RefIdData& referenceable) : mReferencables(referenceable), - mBooksSize(0), - mActivatorsSize(0), - mPotionsSize(0), - mApparatiSize(0), - mArmorsSzie(0), - mClothingSize(0), - mContainersSize(0), - mCreaturesSize(0), - mDoorsSize(0), - mIngredientsSize(0), - mCreaturesLevListsSize(0), - mItemLevelledListsSize(0) + mBooksSize(mReferencables.getBooks().getSize()), + mActivatorsSize(mReferencables.getActivators().getSize()), + mPotionsSize(mReferencables.getPotions().getSize()), + mApparatiSize(mReferencables.getApparati().getSize()), + mArmorsSzie(mReferencables.getArmors().getSize()), + mClothingSize(mReferencables.getClothing().getSize()), + mContainersSize(mReferencables.getContainers().getSize()), + mCreaturesSize(mReferencables.getCreatures().getSize()), + mDoorsSize(mReferencables.getDoors().getSize()), + mIngredientsSize(mReferencables.getIngredients().getSize()), + mCreaturesLevListsSize(mReferencables.getCreatureLevelledLists().getSize()), + mItemLevelledListsSize(mReferencables.getItemLevelledList().getSize()), + mLightsSize(mReferencables.getLights().getSize()) { - setSizeVariables(); -} - -void CSMTools::ReferenceableCheckStage::setSizeVariables() -{ - mBooksSize = mReferencables.getBooks().getSize(); - mActivatorsSize = mReferencables.getActivators().getSize(); - mPotionsSize = mReferencables.getPotions().getSize(); - mApparatiSize = mReferencables.getApparati().getSize(); - mArmorsSzie = mReferencables.getArmors().getSize(); - mClothingSize = mReferencables.getClothing().getSize(); - mContainersSize = mReferencables.getContainers().getSize(); - mCreaturesSize = mReferencables.getCreatures().getSize(); - mDoorsSize = mReferencables.getDoors().getSize(); - mIngredientsSize = mReferencables.getIngredients().getSize(); - mCreaturesLevListsSize = mReferencables.getCreatureLevelledLists().getSize(); - mItemLevelledListsSize = mReferencables.getItemLevelledList().getSize(); } void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::string >& messages) @@ -124,13 +108,13 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str } stage -= mCreaturesLevListsSize; - + if (stage < mItemLevelledListsSize) { - mItemLevelledListCheck(stage, mReferencables.getItemLevelledList(), messages); - return; + mItemLevelledListCheck(stage, mReferencables.getItemLevelledList(), messages); + return; } - + stage -= mItemLevelledListsSize; } @@ -647,7 +631,7 @@ void CSMTools::ReferenceableCheckStage::mItemLevelledListCheck(int stage, const } const ESM::ItemLevList& ItemLevList = (static_cast& >(baserecord)).get(); - CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, CreatureLevList.mId); + CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, ItemLevList.mId); for (int i = 0; i < ItemLevList.mList.size(); ++i) { diff --git a/apps/opencs/model/tools/referenceablecheck.hpp b/apps/opencs/model/tools/referenceablecheck.hpp index 5a0d39ec58..6bffc2b255 100644 --- a/apps/opencs/model/tools/referenceablecheck.hpp +++ b/apps/opencs/model/tools/referenceablecheck.hpp @@ -30,23 +30,22 @@ namespace CSMTools void creaturesLevListCheck(int stage, const CSMWorld::RefIdDataContainer& records, std::vector& messages); void mItemLevelledListCheck(int stage, const CSMWorld::RefIdDataContainer& records, std::vector& messages); - void setSizeVariables(); - const CSMWorld::RefIdData mReferencables; //SIZES OF CONCRETE TYPES - int mBooksSize; - int mActivatorsSize; - int mPotionsSize; - int mApparatiSize; - int mArmorsSzie; - int mClothingSize; - int mContainersSize; - int mCreaturesSize; - int mDoorsSize; - int mIngredientsSize; - int mCreaturesLevListsSize; - int mItemLevelledListsSize; + const int mBooksSize; + const int mActivatorsSize; + const int mPotionsSize; + const int mApparatiSize; + const int mArmorsSzie; + const int mClothingSize; + const int mContainersSize; + const int mCreaturesSize; + const int mDoorsSize; + const int mIngredientsSize; + const int mCreaturesLevListsSize; + const int mItemLevelledListsSize; + const int mLightsSize; }; } #endif // REFERENCEABLECHECKSTAGE_H diff --git a/apps/opencs/model/world/refiddata.cpp b/apps/opencs/model/world/refiddata.cpp index 7f3e6506b6..54e2cd12f6 100644 --- a/apps/opencs/model/world/refiddata.cpp +++ b/apps/opencs/model/world/refiddata.cpp @@ -291,3 +291,8 @@ const CSMWorld::RefIdDataContainer< ESM::ItemLevList >& CSMWorld::RefIdData::get { return mItemLevelledLists; } + +const CSMWorld::RefIdDataContainer< ESM::Light >& CSMWorld::RefIdData::getLights() const +{ + return mLights; +} diff --git a/apps/opencs/model/world/refiddata.hpp b/apps/opencs/model/world/refiddata.hpp index 6e7231a246..6b6e01e012 100644 --- a/apps/opencs/model/world/refiddata.hpp +++ b/apps/opencs/model/world/refiddata.hpp @@ -233,6 +233,7 @@ namespace CSMWorld const RefIdDataContainer& getIngredients() const; const RefIdDataContainer& getCreatureLevelledLists() const; const RefIdDataContainer& getItemLevelledList() const; + const RefIdDataContainer& getLights() const; }; }