Added creatureCheck. I don't know meaning of all data fields here.

actorid
Marek Kochanowicz 11 years ago
parent 94fcea4d4d
commit e4e7d50623

@ -84,13 +84,13 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
}
stage -= mClothingSize;
if (stage < mContainersSize)
{
containerCheck(stage, mReferencables.getContainers(), messages);
return;
containerCheck(stage, mReferencables.getContainers(), messages);
return;
}
stage -= mContainersSize;
}
@ -402,3 +402,99 @@ void CSMTools::ReferenceableCheckStage::containerCheck(int stage, const CSMWorld
messages.push_back(id.toString() + "|" + Container.mId + " has an empty name");
}
}
void CSMTools::ReferenceableCheckStage::creatureCheck(int stage, const CSMWorld::RefIdDataContainer< ESM::Creature >& records, std::vector< std::string >& messages)
{
const CSMWorld::RecordBase& baserecord = records.getRecord(stage);
if (baserecord.isDeleted())
{
return;
}
const ESM::Creature& Creature = (static_cast<const CSMWorld::Record<ESM::Creature>&>(baserecord)).get();
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_Creature, Creature.mId);
if (Creature.mModel.empty())
{
messages.push_back(id.toString() + "|" + Creature.mId + " has no model");
}
if (Creature.mName.empty())
{
messages.push_back(id.toString() + "|" + Creature.mId + " has an empty name");
}
//stats checks
if (Creature.mData.mLevel < 1)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has non-postive level");
}
if (Creature.mData.mStrength < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative strength");
}
if (Creature.mData.mIntelligence < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative intelligence");
}
if (Creature.mData.mWillpower < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative willpower");
}
if (Creature.mData.mAgility < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative agility");
}
if (Creature.mData.mSpeed < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative speed");
}
if (Creature.mData.mEndurance < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative endurance");
}
if (Creature.mData.mPersonality < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative personality");
}
if (Creature.mData.mLuck < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative luck");
}
if (Creature.mData.mHealth < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative health");
}
if (Creature.mData.mSoul < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative soul value");
}
for (int i = 0; i < 6; ++i)
{
if (Creature.mData.mAttack[i] < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative attack strength");
break;
}
}
//TODO, find meaning of other values
/*
if (Creature.mData.mGold < 0)
{
messages.push_back(id.toString() + "|" + Creature.mId + " has negative gold ");
}
*/
}

@ -24,6 +24,7 @@ namespace CSMTools
void armorCheck(int stage, const CSMWorld::RefIdDataContainer<ESM::Armor>& records, std::vector<std::string>& messages);
void clothingCheck(int stage, const CSMWorld::RefIdDataContainer<ESM::Clothing>& records, std::vector<std::string>& messages);
void containerCheck(int stage, const CSMWorld::RefIdDataContainer<ESM::Container>& records, std::vector<std::string>& messages);
void creatureCheck(int stage, const CSMWorld::RefIdDataContainer<ESM::Creature>& records, std::vector<std::string>& messages);
void setSizeVariables();

@ -66,7 +66,7 @@ struct Creature
int mCombat, mMagic, mStealth; // Don't know yet.
int mAttack[6]; // AttackMin1, AttackMax1, ditto2, ditto3
int mGold;
}; // 96 bytes
}; // 96 byte
NPDTstruct mData;

Loading…
Cancel
Save