diff --git a/src/Battling/ScriptHandling/ScriptMacros.hpp b/src/Battling/ScriptHandling/ScriptMacros.hpp index ac4c6aa..fb9edaf 100644 --- a/src/Battling/ScriptHandling/ScriptMacros.hpp +++ b/src/Battling/ScriptHandling/ScriptMacros.hpp @@ -1,7 +1,6 @@ #define HOOK(hookName, source, ...) \ { \ auto aggregator = source->GetScriptIterator(); \ - aggregator.Reset(); \ while (aggregator.HasNext()) { \ auto next = aggregator.GetNext(); \ if (next == nullptr) \ @@ -13,7 +12,6 @@ #define HOOK_LOCAL(hookName, source, ...) \ { \ auto aggregator = source.GetScriptIterator(); \ - aggregator.Reset(); \ while (aggregator.HasNext()) { \ auto next = aggregator.GetNext(); \ if (next == nullptr) \ diff --git a/src/Battling/ScriptHandling/ScriptSource.hpp b/src/Battling/ScriptHandling/ScriptSource.hpp index 8c84a9e..4e3104f 100644 --- a/src/Battling/ScriptHandling/ScriptSource.hpp +++ b/src/Battling/ScriptHandling/ScriptSource.hpp @@ -24,6 +24,7 @@ namespace CreatureLib::Battling { _scriptsIterator = ScriptAggregator(_scripts); _areScriptsInitialized = true; } + _scriptsIterator.Reset(); return _scriptsIterator; } };