Update to latest Arbutils, include stacktrace.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-15 15:10:48 +02:00
parent 46ab060b99
commit c921d3127b
8 changed files with 104 additions and 78 deletions

View File

@@ -1,29 +1,20 @@
#define HOOK(hookName, source, ...) \
{ \
auto aggregator = source->GetScriptIterator(); \
while (aggregator.HasNext()) { \
auto next = aggregator.GetNext(); \
if (next == nullptr) \
continue; \
try { \
next->hookName(__VA_ARGS__); \
} catch (const std::exception& e) { \
THROW_CREATURE("Exception running script hook '" #hookName "': " << e.what()) \
} \
} \
}
#define HOOK_LOCAL(hookName, source, ...) \
{ \
auto aggregator = source.GetScriptIterator(); \
while (aggregator.HasNext()) { \
auto next = aggregator.GetNext(); \
if (next == nullptr) \
continue; \
try { \
next->hookName(__VA_ARGS__); \
} catch (const std::exception& e) { \
THROW_CREATURE("Exception running script hook '" #hookName "': " << e.what()) \
try { \
auto aggregator = source->GetScriptIterator(); \
while (aggregator.HasNext()) { \
auto next = aggregator.GetNext(); \
if (next == nullptr) \
continue; \
try { \
next->hookName(__VA_ARGS__); \
} catch (const std::exception& e) { \
THROW_CREATURE("Exception running script hook '" #hookName "': " << e.what()) \
} \
} \
} catch (const CreatureException& e) { \
throw e; \
} catch (const std::exception& e) { \
THROW_CREATURE("Exception setting up script hook '" #hookName "': " << e.what()) \
} \
}