|
|
|
@ -7,16 +7,7 @@
|
|
|
|
|
|
|
|
|
|
#include "../world/universalid.hpp"
|
|
|
|
|
|
|
|
|
|
CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races)
|
|
|
|
|
: mRaces (races)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
int CSMTools::RaceCheckStage::setup()
|
|
|
|
|
{
|
|
|
|
|
return mRaces.getSize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMTools::RaceCheckStage::perform (int stage, std::vector<std::string>& messages)
|
|
|
|
|
void CSMTools::RaceCheckStage::performPerRecord (int stage, std::vector<std::string>& messages)
|
|
|
|
|
{
|
|
|
|
|
const ESM::Race& race = mRaces.getRecord (stage).get();
|
|
|
|
|
|
|
|
|
@ -43,5 +34,35 @@ void CSMTools::RaceCheckStage::perform (int stage, std::vector<std::string>& mes
|
|
|
|
|
if (race.mData.mWeight.mFemale<0)
|
|
|
|
|
messages.push_back (id.toString() + "|female " + race.mId + " has negative weight");
|
|
|
|
|
|
|
|
|
|
// remember playable flag
|
|
|
|
|
if (race.mData.mFlags & 0x1)
|
|
|
|
|
mPlayable = true;
|
|
|
|
|
|
|
|
|
|
/// \todo check data members that can't be edited in the table view
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMTools::RaceCheckStage::performFinal (std::vector<std::string>& messages)
|
|
|
|
|
{
|
|
|
|
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Races);
|
|
|
|
|
|
|
|
|
|
if (!mPlayable)
|
|
|
|
|
messages.push_back (id.toString() + "|No playable race");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races)
|
|
|
|
|
: mRaces (races), mPlayable (false)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
int CSMTools::RaceCheckStage::setup()
|
|
|
|
|
{
|
|
|
|
|
mPlayable = false;
|
|
|
|
|
return mRaces.getSize()+1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMTools::RaceCheckStage::perform (int stage, std::vector<std::string>& messages)
|
|
|
|
|
{
|
|
|
|
|
if (stage==mRaces.getSize())
|
|
|
|
|
performFinal (messages);
|
|
|
|
|
else
|
|
|
|
|
performPerRecord (stage, messages);
|
|
|
|
|
}
|