refactor delay matching logic

This commit is contained in:
Mashy
2019-12-11 08:25:55 +10:00
parent 279ab5795e
commit 79f5e7e1be
2 changed files with 51 additions and 32 deletions
+2 -3
View File
@@ -89,10 +89,9 @@ function registerEvents(store) {
const newRes = game.resolutions[game.resolutions.length - 2];
console.log(newRes);
return eachSeries(newRes, (r, cb) => {
const timeout = r.delay;
if (timeout === 0) return cb(); // TargetKo etc
if (r.delay === 0) return cb(); // TargetKo etc
setAnimations(r, store);
return setTimeout(cb, timeout);
return setTimeout(cb, r.delay);
}, err => {
if (err) return console.error(err);
clearAnimations(store);