mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 14:15:35 +00:00
improved error handling in LocalScripts::add
This commit is contained in:
parent
baaf801521
commit
b6878c2e0c
1 changed files with 5 additions and 1 deletions
|
@ -93,7 +93,7 @@ std::pair<std::string, MWWorld::Ptr> MWWorld::LocalScripts::getNext()
|
|||
|
||||
void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||
{
|
||||
if (const ESM::Script *script = mStore.get<ESM::Script>().find (scriptName))
|
||||
if (const ESM::Script *script = mStore.get<ESM::Script>().search (scriptName))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -108,6 +108,10 @@ void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
|||
<< " because an exception has been thrown: " << exception.what() << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
std::cerr
|
||||
<< "failed to add local script " << scriptName
|
||||
<< " because the script does not exist." << std::endl;
|
||||
}
|
||||
|
||||
void MWWorld::LocalScripts::addCell (CellStore *cell)
|
||||
|
|
Loading…
Reference in a new issue