Update class and race record verifier messages

pull/541/head
Capostrophic 6 years ago
parent fd1a3ad88d
commit 7535daa94d

@ -37,11 +37,11 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
// A class should have a name
if (class_.mName.empty())
messages.push_back (std::make_pair (id, class_.mId + " doesn't have a name"));
messages.push_back (std::make_pair (id, "Name is missing"));
// A playable class should have a description
if (class_.mData.mIsPlayable != 0 && class_.mDescription.empty())
messages.push_back (std::make_pair (id, class_.mId + " doesn't have a description and it's playable"));
messages.push_back (std::make_pair (id, "Description of a playable class is missing"));
// test for invalid attributes
for (int i=0; i<2; ++i)
@ -49,14 +49,14 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
{
std::ostringstream stream;
stream << "Attribute #" << i << " of " << class_.mId << " is not set";
stream << "Attribute #" << i << " is not set";
messages.push_back (std::make_pair (id, stream.str()));
}
if (class_.mData.mAttribute[0]==class_.mData.mAttribute[1] && class_.mData.mAttribute[0]!=-1)
{
messages.push_back (std::make_pair (id, "Class lists same attribute twice"));
messages.push_back (std::make_pair (id, "Same attribute is listed twice"));
}
// test for non-unique skill
@ -66,10 +66,9 @@ void CSMTools::ClassCheckStage::perform (int stage, CSMDoc::Messages& messages)
for (int i2=0; i2<2; ++i2)
++skills[class_.mData.mSkills[i][i2]];
for (std::map<int, int>::const_iterator iter (skills.begin()); iter!=skills.end(); ++iter)
if (iter->second>1)
for (auto &skill : skills)
if (skill.second>1)
{
messages.push_back (std::make_pair (id,
ESM::Skill::indexToId (iter->first) + " is listed more than once"));
messages.push_back (std::make_pair (id, "Skill " + ESM::Skill::indexToId (skill.first) + " is listed more than once"));
}
}

@ -29,24 +29,24 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, CSMDoc::Messages& me
// test for empty name and description
if (race.mName.empty())
messages.push_back (std::make_pair (id, race.mId + " has an empty name"));
messages.push_back (std::make_pair (id, "Name is missing"));
if (race.mDescription.empty())
messages.push_back (std::make_pair (id, race.mId + " has an empty description"));
messages.push_back (std::make_pair (id, "Description is missing"));
// test for positive height
if (race.mData.mHeight.mMale<=0)
messages.push_back (std::make_pair (id, "male " + race.mId + " has non-positive height"));
messages.push_back (std::make_pair (id, "Male height is non-positive"));
if (race.mData.mHeight.mFemale<=0)
messages.push_back (std::make_pair (id, "female " + race.mId + " has non-positive height"));
messages.push_back (std::make_pair (id, "Female height is non-positive"));
// test for non-negative weight
if (race.mData.mWeight.mMale<0)
messages.push_back (std::make_pair (id, "male " + race.mId + " has negative weight"));
messages.push_back (std::make_pair (id, "Male weight is negative"));
if (race.mData.mWeight.mFemale<0)
messages.push_back (std::make_pair (id, "female " + race.mId + " has negative weight"));
messages.push_back (std::make_pair (id, "Female weight is negative"));
/// \todo check data members that can't be edited in the table view
}

Loading…
Cancel
Save