fix cb for banish/invert
This commit is contained in:
parent
d03eec1423
commit
ef11d14752
@ -65,7 +65,10 @@ function registerEvents(store) {
|
||||
store.dispatch(actions.setAnimFocus(animations.getFocusTargets(r)));
|
||||
|
||||
if (sequence.includes('START_SKILL')) store.dispatch(actions.setAnimSource(anims.animSource));
|
||||
if (sequence.includes('END_SKILL')) store.dispatch(actions.setAnimTarget(anims.animTarget));
|
||||
if (sequence.includes('END_SKILL')) {
|
||||
store.dispatch(actions.setAnimTarget(anims.animTarget));
|
||||
if (!['Banish', 'Invert'].includes(anims.animTarget.skill)) store.dispatch(actions.setAnimCb(cb));
|
||||
}
|
||||
if (sequence.includes('POST_SKILL')) {
|
||||
// timeout to prevent text classes from being added too soon
|
||||
setTimeout(
|
||||
@ -73,21 +76,14 @@ function registerEvents(store) {
|
||||
timeout - TIMES.POST_SKILL_DURATION_MS
|
||||
);
|
||||
}
|
||||
|
||||
return setTimeout(() => {
|
||||
const clearAnimProps = () => {
|
||||
store.dispatch(actions.setAnimSource(null));
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
store.dispatch(actions.setAnimText(null));
|
||||
store.dispatch(actions.setAnimFocus([]));
|
||||
};
|
||||
if (sequence.includes('END_SKILL')) {
|
||||
// If we are have an animation playing let the anim return cb()
|
||||
store.dispatch(actions.setAnimCb(cb));
|
||||
return clearAnimProps();
|
||||
}
|
||||
clearAnimProps();
|
||||
return cb();
|
||||
if (!sequence.includes('END_SKILL')
|
||||
|| ['Banish', 'Invert'].includes(anims.animTarget.skill)) return cb();
|
||||
return true;
|
||||
}, timeout);
|
||||
}, err => {
|
||||
if (err) return console.error(err);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user