Implemented better script handling.
This commit is contained in:
14
src/Battling/ScriptHandling/ScriptMacros.cpp
Normal file
14
src/Battling/ScriptHandling/ScriptMacros.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#define HOOK(hookName, sources, ... ) \
|
||||
{ \
|
||||
auto aggregator = CreatureLib::Battling::ScriptAggregator(); \
|
||||
for (auto source: sources){ \
|
||||
source -> GetActiveScripts(aggregator); \
|
||||
} \
|
||||
while (aggregator.HasNext()){ \
|
||||
auto next = aggregator.GetNext(); \
|
||||
if (next == nullptr) continue; \
|
||||
next->hookName(__VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user