From 9d83ba22d5feb17a888ab6f201eeae5ffeed3333 Mon Sep 17 00:00:00 2001 From: gparant Date: Tue, 7 Apr 2020 23:56:16 +0200 Subject: [PATCH] Fix play anim --- front/src/Phaser/Player/Animation.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/front/src/Phaser/Player/Animation.ts b/front/src/Phaser/Player/Animation.ts index 38f2afd3..eb8298f4 100644 --- a/front/src/Phaser/Player/Animation.ts +++ b/front/src/Phaser/Player/Animation.ts @@ -49,11 +49,7 @@ export const getPlayerAnimations = (PlayerValue : string): AnimationData[] => { export const playAnimation = (Player : Phaser.GameObjects.Sprite, direction : string) => { if (!Player.anims.currentAnim || Player.anims.currentAnim.key !== direction) { - if (direction !== PlayerAnimationNames.None) { - Player.anims.play(direction); - } else if (Player.anims.isPlaying) { - Player.anims.stop(); - } + Player.anims.play(direction); } else if (direction === PlayerAnimationNames.None && Player.anims.currentAnim) { Player.anims.currentAnim.destroy(); }