mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
silence an error regarding faced handle
This commit is contained in:
parent
13efe68fc3
commit
4e63f89829
@ -82,12 +82,20 @@ void OMW::Engine::updateFocusReport (float duration)
|
|||||||
|
|
||||||
if (!handle.empty())
|
if (!handle.empty())
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
|
// the faced handle is not updated immediately, so on a cell change it might
|
||||||
|
// point to an object that doesn't exist anymore
|
||||||
|
// therefore, we are catching the "Unknown Ogre handle" exception that occurs in this case
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MWWorld::Ptr ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
|
||||||
|
|
||||||
if (!ptr.isEmpty()){
|
if (!ptr.isEmpty()){
|
||||||
name = MWWorld::Class::get (ptr).getName (ptr);
|
name = MWWorld::Class::get (ptr).getName (ptr);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (std::runtime_error& e)
|
||||||
|
{}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name!=mFocusName)
|
if (name!=mFocusName)
|
||||||
@ -415,10 +423,21 @@ void OMW::Engine::activate()
|
|||||||
if (handle.empty())
|
if (handle.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MWWorld::Ptr ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
|
// the faced handle is not updated immediately, so on a cell change it might
|
||||||
|
// point to an object that doesn't exist anymore
|
||||||
|
// therefore, we are catching the "Unknown Ogre handle" exception that occurs in this case
|
||||||
|
MWWorld::Ptr ptr;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
|
||||||
|
|
||||||
if (ptr.isEmpty())
|
if (ptr.isEmpty())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (std::runtime_error&)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MWScript::InterpreterContext interpreterContext (mEnvironment,
|
MWScript::InterpreterContext interpreterContext (mEnvironment,
|
||||||
&ptr.getRefData().getLocals(), ptr);
|
&ptr.getRefData().getLocals(), ptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user