1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +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
parent cbb124ab4f
commit 81c7ce5b06
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);