From 32bb641f75012db0c74e28536a3f14d33df6e9b6 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 12 Jun 2020 15:49:37 +0200 Subject: [PATCH] Fixed issue with underflow in ScriptAggregator. --- src/Battling/ScriptHandling/ScriptAggregator.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Battling/ScriptHandling/ScriptAggregator.hpp b/src/Battling/ScriptHandling/ScriptAggregator.hpp index da329ac..6ddb334 100644 --- a/src/Battling/ScriptHandling/ScriptAggregator.hpp +++ b/src/Battling/ScriptHandling/ScriptAggregator.hpp @@ -40,7 +40,9 @@ namespace CreatureLib::Battling { inline void Reset() { _index = 0; - _setIndex = -1; + if (_scripts[_index].IsSet()) { + _setIndex = -1; + } IncrementToNextNotNull(false); } inline bool HasNext() { return _index < _size; }