mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 12:53:51 +00:00
Exceptions from input handlers are now caught in OpenEngine as opposed to requring a try/catch in the input handler itself
This commit is contained in:
parent
26b9d0fdc3
commit
51f859651d
1 changed files with 17 additions and 1 deletions
|
@ -47,8 +47,24 @@ struct Dispatcher : Mangle::Input::Event
|
||||||
const _O &list = map.getList(index);
|
const _O &list = map.getList(index);
|
||||||
_O::const_iterator it;
|
_O::const_iterator it;
|
||||||
for(it = list.begin(); it != list.end(); it++)
|
for(it = list.begin(); it != list.end(); it++)
|
||||||
|
{
|
||||||
|
//catch exceptions thrown in the input handlers so that pressing a key
|
||||||
|
//doesn't cause OpenMw to crash
|
||||||
|
try
|
||||||
|
{
|
||||||
funcs.call(*it, p);
|
funcs.call(*it, p);
|
||||||
}
|
}
|
||||||
|
catch(const std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "Exception in input handler: " << e.what() << std::endl;
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
std::cerr << "Unknown exception in input handler" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// This helps us play nice with Mangle's EventPtr, but it should
|
// This helps us play nice with Mangle's EventPtr, but it should
|
||||||
|
|
Loading…
Reference in a new issue