Skip to content

Commit b7ccae4

Browse files
committed
Try to avoid the double-resolve race condition.
1 parent 42490ff commit b7ccae4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/nodes/Player.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ export default class Player extends GameNode {
205205
}
206206

207207
async resolve() {
208+
// Don't trigger if we're already paused for something else
209+
if (this.currentState === "pause") {
210+
return;
211+
}
208212
this.currentState = "pause";
209213
if (
210214
await this.board.resolve((score) => {

0 commit comments

Comments
 (0)