Skip to content

Commit

Permalink
Don't perform newly added actions if player is paused (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
eoghanmurray authored Apr 18, 2021
1 parent fbfb962 commit 7c5e15d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/replay/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,14 @@ export function createPlayerService(
const castFn = getCastFn(event, isSync);
if (isSync) {
castFn();
} else {
} else if (timer.isActive()) {
timer.addAction({
doAction: () => {
castFn();
emitter.emit(ReplayerEvents.EventCast, event);
},
delay: event.delay!,
});
if (!timer.isActive()) {
timer.start();
}
}
}
return { ...ctx, events };
Expand Down

0 comments on commit 7c5e15d

Please sign in to comment.