mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-15 23:42:20 +00:00
catch exceptions from adding local scripts
This commit is contained in:
parent
89beecad8c
commit
e4b6f135b6
@ -93,9 +93,18 @@ void MWWorld::LocalScripts::add (const std::string& scriptName, const Ptr& ptr)
|
||||
{
|
||||
if (const ESM::Script *script = mStore.get<ESM::Script>().find (scriptName))
|
||||
{
|
||||
ptr.getRefData().setLocals (*script);
|
||||
try
|
||||
{
|
||||
ptr.getRefData().setLocals (*script);
|
||||
|
||||
mScripts.push_back (std::make_pair (scriptName, ptr));
|
||||
mScripts.push_back (std::make_pair (scriptName, ptr));
|
||||
}
|
||||
catch (const std::exception& exception)
|
||||
{
|
||||
std::cerr
|
||||
<< "failed to add local script " << scriptName
|
||||
<< " because an exception has been thrown: " << exception.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user