catch exceptions from adding local scripts

deque
Marc Zinnschlag 10 years ago
parent 89beecad8c
commit e4b6f135b6

@ -92,11 +92,20 @@ 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))
{
try
{
ptr.getRefData().setLocals (*script);
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;
}
}
}
void MWWorld::LocalScripts::addCell (CellStore *cell)

Loading…
Cancel
Save