fix for potential script problem during saved game loading

pull/288/head
Marc Zinnschlag 10 years ago
parent 5c8ef842b6
commit aa7fc8ee47

@ -30,8 +30,18 @@ void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
{
if (const ESM::Script* script = MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().search (scriptId))
{
mData.setLocals (*script);
mData.getLocals().read (state.mLocals, scriptId);
try
{
mData.setLocals (*script);
mData.getLocals().read (state.mLocals, scriptId);
}
catch (const std::exception& exception)
{
std::cerr
<< "failed to load state for local script " << scriptId
<< " because an exception has been thrown: " << exception.what()
<< std::endl;
}
}
}
}

Loading…
Cancel
Save