Do NOT use maximum loop logic when steppign throuhg a sequence without a max loop

This commit is contained in:
mmcw-dev 2017-12-20 21:26:59 -05:00
parent 64b0244972
commit a039e8f616
1 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,12 @@ sequence.setStop = function () {
sequence.stop = function () {
sequence._state.active = false
sequence._state.count = 0
sequence._state.arr = []
sequence._loop.count = 0
sequence._loop.max = 0
sequence._loop.arr = []
if (sequence._state.stop) sequence._state.stop()
sequence._state.stop = null
}
@ -79,7 +84,7 @@ sequence.step = function () {
sequence._state.count = 0
sequence._loop.count++
}
if (sequence._loop.count > sequence._loop.max) {
if (sequence._loop.max > 0 &&sequence._loop.count > sequence._loop.max) {
return sequence.stop()
}
return sequence._loop.arr[sequence._state.count](() => {