Move ScriptIterator reset to get call instead of inside Macro.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-06-02 13:21:23 +02:00
parent f898698f49
commit dba1275813
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,6 @@
#define HOOK(hookName, source, ...) \ #define HOOK(hookName, source, ...) \
{ \ { \
auto aggregator = source->GetScriptIterator(); \ auto aggregator = source->GetScriptIterator(); \
aggregator.Reset(); \
while (aggregator.HasNext()) { \ while (aggregator.HasNext()) { \
auto next = aggregator.GetNext(); \ auto next = aggregator.GetNext(); \
if (next == nullptr) \ if (next == nullptr) \
@ -13,7 +12,6 @@
#define HOOK_LOCAL(hookName, source, ...) \ #define HOOK_LOCAL(hookName, source, ...) \
{ \ { \
auto aggregator = source.GetScriptIterator(); \ auto aggregator = source.GetScriptIterator(); \
aggregator.Reset(); \
while (aggregator.HasNext()) { \ while (aggregator.HasNext()) { \
auto next = aggregator.GetNext(); \ auto next = aggregator.GetNext(); \
if (next == nullptr) \ if (next == nullptr) \

View File

@ -24,6 +24,7 @@ namespace CreatureLib::Battling {
_scriptsIterator = ScriptAggregator(_scripts); _scriptsIterator = ScriptAggregator(_scripts);
_areScriptsInitialized = true; _areScriptsInitialized = true;
} }
_scriptsIterator.Reset();
return _scriptsIterator; return _scriptsIterator;
} }
}; };