Minor fixes for ScriptAggregator
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-04-17 14:44:33 +02:00
parent 96cbd594a0
commit 33f796eff8
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 6 additions and 6 deletions

View File

@ -8,15 +8,15 @@
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class ScriptAggregator { class ScriptAggregator {
const ScriptWrapper *_scripts; const ScriptWrapper *_scripts;
size_t _size; i32 _size;
size_t _index = 0; i32 _index = 0;
size_t _setIndex = 0; i32 _setIndex = 0;
inline void IncrementToNextNotNull(bool initialIncrement = true) { inline void IncrementToNextNotNull(bool initialIncrement = true) {
if (_scripts[_index].IsSet()) { if (_scripts[_index].IsSet()) {
_setIndex++; _setIndex++;
if (_setIndex >= _scripts[_index].GetScriptSet()->Count()) { if (_setIndex >= (i32) _scripts[_index].GetScriptSet()->Count()) {
_setIndex = 0; _setIndex = -1;
} else { } else {
return; return;
} }