mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 12:45:34 +00:00
fix for potential script problem during saved game loading
This commit is contained in:
parent
5c8ef842b6
commit
aa7fc8ee47
1 changed files with 12 additions and 2 deletions
|
@ -29,10 +29,20 @@ void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
|
||||||
if (!scriptId.empty())
|
if (!scriptId.empty())
|
||||||
{
|
{
|
||||||
if (const ESM::Script* script = MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().search (scriptId))
|
if (const ESM::Script* script = MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().search (scriptId))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
mData.setLocals (*script);
|
mData.setLocals (*script);
|
||||||
mData.getLocals().read (state.mLocals, scriptId);
|
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…
Reference in a new issue