From aa7fc8ee47d77076e3bcd95ef1e8b273868748aa Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 22 Sep 2014 10:12:07 +0200 Subject: [PATCH] fix for potential script problem during saved game loading --- apps/openmw/mwworld/livecellref.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/livecellref.cpp b/apps/openmw/mwworld/livecellref.cpp index 0921d3a1b..dd313632b 100644 --- a/apps/openmw/mwworld/livecellref.cpp +++ b/apps/openmw/mwworld/livecellref.cpp @@ -30,8 +30,18 @@ void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state) { if (const ESM::Script* script = MWBase::Environment::get().getWorld()->getStore().get().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; + } } } }