Support for specific PkmnLib functions in Scripts, added ModifyCriticalStage function.
This commit is contained in:
13
src/Battling/PkmnScriptHook.hpp
Normal file
13
src/Battling/PkmnScriptHook.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "PkmnScript.hpp"
|
||||
|
||||
#define PKMN_HOOK(hookName, source, ...) \
|
||||
{ \
|
||||
auto aggregator = source->GetScriptIterator(); \
|
||||
while (aggregator.HasNext()) { \
|
||||
auto next = aggregator.GetNext(); \
|
||||
if (next == nullptr) \
|
||||
continue; \
|
||||
auto castNext = dynamic_cast<PkmnLib::Battling::PkmnScript*>(next); \
|
||||
castNext->hookName(__VA_ARGS__); \
|
||||
} \
|
||||
}
|
||||
Reference in New Issue
Block a user