19 lines
2.0 KiB
C++
19 lines
2.0 KiB
C++
#define HOOK(hookName, source, ...) \
|
|
{ \
|
|
try { \
|
|
auto aggregator = (source)->GetScriptIterator(); \
|
|
ArbUt::BorrowedPtr<CreatureLib::Battling::BattleScript> next = (CreatureLib::Battling::BattleScript*)1; \
|
|
while (aggregator.GetNext(next)) { \
|
|
try { \
|
|
next->hookName(__VA_ARGS__); \
|
|
} catch (const std::exception& e) { \
|
|
THROW("Exception running script hook '" #hookName "': " << e.what()) \
|
|
} \
|
|
} \
|
|
} catch (const ArbUt::Exception& e) { \
|
|
throw e; \
|
|
} catch (const std::exception& e) { \
|
|
THROW("Exception setting up script hook '" #hookName "': " << e.what()) \
|
|
} \
|
|
}
|