mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53:53 +00:00
check for at least one playable race
This commit is contained in:
parent
9bc3945f40
commit
98e7b3fd93
2 changed files with 36 additions and 10 deletions
|
@ -7,16 +7,7 @@
|
||||||
|
|
||||||
#include "../world/universalid.hpp"
|
#include "../world/universalid.hpp"
|
||||||
|
|
||||||
CSMTools::RaceCheckStage::RaceCheckStage (const CSMWorld::IdCollection<ESM::Race>& races)
|
void CSMTools::RaceCheckStage::performPerRecord (int stage, std::vector<std::string>& messages)
|
||||||
: mRaces (races)
|
|
||||||
{}
|
|
||||||
|
|
||||||
int CSMTools::RaceCheckStage::setup()
|
|
||||||
{
|
|
||||||
return mRaces.getSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CSMTools::RaceCheckStage::perform (int stage, std::vector<std::string>& messages)
|
|
||||||
{
|
{
|
||||||
const ESM::Race& race = mRaces.getRecord (stage).get();
|
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)
|
if (race.mData.mWeight.mFemale<0)
|
||||||
messages.push_back (id.toString() + "|female " + race.mId + " has negative weight");
|
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
|
/// \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);
|
||||||
|
}
|
|
@ -13,6 +13,11 @@ namespace CSMTools
|
||||||
class RaceCheckStage : public Stage
|
class RaceCheckStage : public Stage
|
||||||
{
|
{
|
||||||
const CSMWorld::IdCollection<ESM::Race>& mRaces;
|
const CSMWorld::IdCollection<ESM::Race>& mRaces;
|
||||||
|
bool mPlayable;
|
||||||
|
|
||||||
|
void performPerRecord (int stage, std::vector<std::string>& messages);
|
||||||
|
|
||||||
|
void performFinal (std::vector<std::string>& messages);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue