1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 07:15:32 +00:00

Add the proper getErrors() method to CellCreator.

Fix the impossibility of the Exterior Cell creation.
This commit is contained in:
Stanislav Bas 2015-06-27 21:59:16 +03:00 committed by cc9cii
parent 9ef3dced90
commit 0809a738b8
2 changed files with 18 additions and 0 deletions

View file

@ -106,3 +106,17 @@ void CSVWorld::CellCreator::cloneMode(const std::string& originId,
mType->setCurrentIndex(0);
}
}
std::string CSVWorld::CellCreator::getErrors() const
{
std::string errors;
if (mType->currentIndex() == 0)
{
errors = GenericCreator::getErrors();
}
else if (getData().hasId(getId()))
{
errors = "The Exterior Cell is already exist";
}
return errors;
}

View file

@ -35,6 +35,10 @@ namespace CSVWorld
virtual void cloneMode(const std::string& originId,
const CSMWorld::UniversalId::Type type);
virtual std::string getErrors() const;
///< Return formatted error descriptions for the current state of the creator. if an empty
/// string is returned, there is no error.
private slots:
void setType (int index);