summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2024-01-10 07:26:16 +0900
committerGitHub <noreply@github.com>2024-01-10 07:26:16 +0900
commitf5b864df7bedc3b4a7abdfb09a3df9c2db8c3627 (patch)
tree7851db4c608f8be3a7b6d228496bf77d9e50c6d5 /packages/frontend/src/scripts
parentUpdate CHANGELOG.md (#12953) (diff)
downloadsharkey-f5b864df7bedc3b4a7abdfb09a3df9c2db8c3627.tar.gz
sharkey-f5b864df7bedc3b4a7abdfb09a3df9c2db8c3627.tar.bz2
sharkey-f5b864df7bedc3b4a7abdfb09a3df9c2db8c3627.zip
fix(frontend): fix game replay
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/drop-and-fusion-engine.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/frontend/src/scripts/drop-and-fusion-engine.ts b/packages/frontend/src/scripts/drop-and-fusion-engine.ts
index 9db93d1534..16fe87d97a 100644
--- a/packages/frontend/src/scripts/drop-and-fusion-engine.ts
+++ b/packages/frontend/src/scripts/drop-and-fusion-engine.ts
@@ -500,12 +500,13 @@ export class DropAndFusionGame extends EventEmitter<{
});
this.emit('changeStock', this.stock);
- const x = Math.min(this.gameWidth - this.PLAYAREA_MARGIN - (head.mono.size / 2), Math.max(this.PLAYAREA_MARGIN + (head.mono.size / 2), Math.round(_x)));
+ const inputX = Math.round(_x);
+ const x = Math.min(this.gameWidth - this.PLAYAREA_MARGIN - (head.mono.size / 2), Math.max(this.PLAYAREA_MARGIN + (head.mono.size / 2), inputX));
const body = this.createBody(head.mono, x, 50 + head.mono.size / 2);
this.logs.push({
frame: this.frame,
operation: 'drop',
- x,
+ x: inputX,
});
Matter.Composite.add(this.engine.world, body);
this.activeBodyIds.push(body.id);