removing member size values, since this does not work properly.

This commit is contained in:
Marek Kochanowicz 2013-12-29 20:15:00 +01:00
parent bf0383fe05
commit 9df6d23afc
2 changed files with 64 additions and 67 deletions

View file

@ -12,142 +12,156 @@
CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(const CSMWorld::RefIdData& referenceable, const CSMWorld::IdCollection<ESM::Race >& races, const CSMWorld::IdCollection<ESM::Class>& classes) : CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(const CSMWorld::RefIdData& referenceable, const CSMWorld::IdCollection<ESM::Race >& races, const CSMWorld::IdCollection<ESM::Class>& classes) :
mReferencables(referenceable), mReferencables(referenceable),
mClasses(classes), mClasses(classes),
mRaces(races), mRaces(races)
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()),
mLockpicksSize(mReferencables.getLocpicks().getSize()),
mMiscellaneousSize(mReferencables.getMiscellaneous().getSize()),
mNPCsSize(mReferencables.getNPCs().getSize())
{ {
} }
void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::string >& messages) void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::string >& 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.
if (stage < mBooksSize) const int BookSize(mReferencables.getBooks().getSize());
if (stage < BookSize)
{ {
bookCheck(stage, mReferencables.getBooks(), messages); bookCheck(stage, mReferencables.getBooks(), messages);
return; return;
} }
stage -= mBooksSize; stage -= BookSize;
if (stage < mActivatorsSize) const int ActivatorSize(mReferencables.getActivators().getSize());
if (stage < ActivatorSize)
{ {
activatorCheck(stage, mReferencables.getActivators(), messages); activatorCheck(stage, mReferencables.getActivators(), messages);
return; return;
} }
stage -= mActivatorsSize; stage -= ActivatorSize;
if (stage < mPotionsSize) const int PotionSize(mReferencables.getActivators().getSize());
if (stage < PotionSize)
{ {
potionCheck(stage, mReferencables.getPotions(), messages); potionCheck(stage, mReferencables.getPotions(), messages);
return; return;
} }
stage -= mPotionsSize; stage -= PotionSize;
if (stage < mApparatiSize) const int ApparatusSize(mReferencables.getApparati().getSize());
if (stage < ApparatusSize)
{ {
apparatusCheck(stage, mReferencables.getApparati(), messages); apparatusCheck(stage, mReferencables.getApparati(), messages);
return; return;
} }
stage -= mApparatiSize; stage -= ApparatusSize;
if (stage < mArmorsSzie) const int ArmorSize(mReferencables.getArmors().getSize());
if (stage < ArmorSize)
{ {
armorCheck(stage, mReferencables.getArmors(), messages); armorCheck(stage, mReferencables.getArmors(), messages);
return; return;
} }
stage -= mArmorsSzie; stage -= ArmorSize;
if (stage < mClothingSize) const int ClothingSize(mReferencables.getClothing().getSize());
if (stage < ClothingSize)
{ {
clothingCheck(stage, mReferencables.getClothing(), messages); clothingCheck(stage, mReferencables.getClothing(), messages);
return; return;
} }
stage -= mClothingSize; stage -= ClothingSize;
if (stage < mContainersSize) const int ContainerSize(mReferencables.getContainers().getSize());
if (stage < ContainerSize)
{ {
containerCheck(stage, mReferencables.getContainers(), messages); containerCheck(stage, mReferencables.getContainers(), messages);
return; return;
} }
stage -= mContainersSize; stage -= ContainerSize;
if (stage < mDoorsSize) const int DoorSize(mReferencables.getDoors().getSize());
if (stage < DoorSize)
{ {
doorCheck(stage, mReferencables.getDoors(), messages); doorCheck(stage, mReferencables.getDoors(), messages);
return; return;
} }
stage -= mDoorsSize; stage -= DoorSize;
if (stage < mIngredientsSize) const int IngredientSize(mReferencables.getIngredients().getSize());
if (stage < IngredientSize)
{ {
ingredientCheck(stage, mReferencables.getIngredients(), messages); ingredientCheck(stage, mReferencables.getIngredients(), messages);
return; return;
} }
stage -= mIngredientsSize; stage -= IngredientSize;
if (stage < mCreaturesLevListsSize) const int CreatureLevListSize(mReferencables.getCreatureLevelledLists().getSize());
if (stage < CreatureLevListSize)
{ {
creaturesLevListCheck(stage, mReferencables.getCreatureLevelledLists(), messages); creaturesLevListCheck(stage, mReferencables.getCreatureLevelledLists(), messages);
return; return;
} }
stage -= mCreaturesLevListsSize; stage -= CreatureLevListSize;
if (stage < mItemLevelledListsSize) const int ItemLevelledListSize(mReferencables.getItemLevelledList().getSize());
if (stage < ItemLevelledListSize)
{ {
itemLevelledListCheck(stage, mReferencables.getItemLevelledList(), messages); itemLevelledListCheck(stage, mReferencables.getItemLevelledList(), messages);
return; return;
} }
stage -= mItemLevelledListsSize; stage -= ItemLevelledListSize;
if (stage < mLightsSize) const int LightSize(mReferencables.getLights().getSize());
if (stage < LightSize)
{ {
lightCheck(stage, mReferencables.getLights(), messages); lightCheck(stage, mReferencables.getLights(), messages);
return; return;
} }
stage -= mLightsSize; stage -= LightSize;
if (stage < mLockpicksSize) const int LockpickSize(mReferencables.getLocpicks().getSize());
if (stage < LockpickSize)
{ {
lockpickCheck(stage, mReferencables.getLocpicks(), messages); lockpickCheck(stage, mReferencables.getLocpicks(), messages);
return; return;
} }
stage -= mLockpicksSize; stage -= LockpickSize;
if (stage < mMiscellaneousSize) const int MiscSize(mReferencables.getMiscellaneous().getSize());
if (stage < MiscSize)
{ {
miscCheck(stage, mReferencables.getMiscellaneous(), messages); miscCheck(stage, mReferencables.getMiscellaneous(), messages);
return; return;
} }
stage -= mMiscellaneousSize; stage -= MiscSize;
if (stage < mNPCsSize) const int NPCSize(mReferencables.getNPCs().getSize());
if (stage < NPCSize)
{ {
npcCheck(stage, mReferencables.getNPCs(), messages); npcCheck(stage, mReferencables.getNPCs(), messages);
return; return;
@ -963,6 +977,7 @@ void CSMTools::ReferenceableCheckStage::npcCheck(int stage, const CSMWorld::RefI
break; break;
} }
} }
if (nosuchrace) if (nosuchrace)
{ {
messages.push_back(id.toString() + "|" + NPC.mId + " has invalid race"); messages.push_back(id.toString() + "|" + NPC.mId + " has invalid race");

View file

@ -37,24 +37,6 @@ namespace CSMTools
const CSMWorld::RefIdData& mReferencables; const CSMWorld::RefIdData& mReferencables;
const CSMWorld::IdCollection<ESM::Race>& mRaces; const CSMWorld::IdCollection<ESM::Race>& mRaces;
const CSMWorld::IdCollection<ESM::Class>& mClasses; const CSMWorld::IdCollection<ESM::Class>& mClasses;
//SIZES OF CONCRETE TYPES
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;
const int mLockpicksSize;
const int mMiscellaneousSize;
const int mNPCsSize;
}; };
} }
#endif // REFERENCEABLECHECKSTAGE_H #endif // REFERENCEABLECHECKSTAGE_H