mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 12:39:59 +00:00
improved error handling in LocalScripts::add
This commit is contained in:
parent
baaf801521
commit
b6878c2e0c
@ -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…
x
Reference in New Issue
Block a user