Ensure we have a multiple of the delay in duration, and tick by the delay
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2020-07-13 17:46:11 +02:00
parent 8c3df1dfa2
commit 7a5bb1108a
1 changed files with 4 additions and 1 deletions

View File

@ -149,7 +149,10 @@ func main() {
}
if overrideEffect.Effect == "queue" {
if currentEffect.Duration > 0 {
currentEffect.Duration -= 40
if currentEffect.Duration%uint16(msDelay) != 0 {
currentEffect.Duration = uint16(currentEffect.Duration/uint16(msDelay)) * uint16(msDelay)
}
currentEffect.Duration -= uint16(msDelay)
} else {
if len(globalEffectChannel) > 0 {
previousEffect.Effect = "queue"