From: gparant Date: Tue, 7 Apr 2020 21:56:16 +0000 (+0200) Subject: Fix play anim X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9d83ba22d5feb17a888ab6f201eeae5ffeed3333;p=libreadventure.git Fix play anim --- diff --git a/front/src/Phaser/Player/Animation.ts b/front/src/Phaser/Player/Animation.ts index 38f2afd..eb8298f 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(); }