From 9de13faff2fa4864f189a9d812e08ee5e33dc807 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Wed, 1 Dec 2021 10:45:01 +0100 Subject: [PATCH] fixed bug with woka picture snapshot taking current frame and not front --- front/src/Phaser/Entity/Character.ts | 1 + front/src/Phaser/Game/GameScene.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts index 1f7b80ed..bf85ed59 100644 --- a/front/src/Phaser/Entity/Character.ts +++ b/front/src/Phaser/Entity/Character.ts @@ -120,6 +120,7 @@ export abstract class Character extends Container { public async getSnapshot(): Promise { const rt = this.scene.make.renderTexture({}, false); for (const sprite of this.sprites.values()) { + sprite.setFrame(1); rt.draw(sprite, sprite.displayWidth * 0.5, sprite.displayHeight * 0.5); } return new Promise((resolve, reject) => { diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 95604c2c..62414767 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -201,7 +201,7 @@ export class GameScene extends DirtyScene { private objectsByType = new Map(); private embeddedWebsiteManager!: EmbeddedWebsiteManager; private loader: Loader; - private userWokaPictureStores: Map = new Map(); + private userWokaPictureStores: Map = new Map(); constructor(private room: Room, MapUrlFile: string, customKey?: string | undefined) { super({