Skip to content

Commit

Permalink
fix(command-queue): fix bug where delta time isn't tracked correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
DarcyRayner committed Feb 27, 2019
1 parent 41d1c0c commit 19c95f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/command-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class CommandQueue {
}

/**
* Updates the <c>CommandQueue</c>. This causes CommandDelegates to be executed
* Updates the `CommandQueue`. This causes CommandDelegates to be executed
* in the order than are enqueued. Update will return after a `Command` elects to pause. This method can't be called
* recursively.
* @param deltaTime The time, in seconds, since the last update. Must be >= 0.
Expand Down Expand Up @@ -97,12 +97,13 @@ export class CommandQueue {
}

const result = this.currentCommand(this.deltaTimeAccumulation, operation);
this._deltaTimeAccumulation = result.deltaTime;
if (result.complete) {
this.currentCommand = undefined;
}

// Only run again if an action just finished,
// (indicated by currentCommand == null), and we have more actions.
// (indicated by currentCommand === undefined), and we have more actions.
shouldRun = result.complete && this.commands.length !== 0 && !this.paused;
}
}
Expand Down

0 comments on commit 19c95f4

Please # to comment.