From 9c56c15a6c2f6a3096601213e37bdcaed583cdd3 Mon Sep 17 00:00:00 2001 From: Acelynn Zhang <102631387+acelynnzhang@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:23:04 -0500 Subject: [PATCH] [P3] Fix persisting sleep animation when sprite is already loaded (#4562) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure that a Pokémon's animation speed is reset properly after saving and quitting. Previously, if a Pokémon was put to sleep, which slows its framerate, saving and quitting would result in the slower framerate persisting even though the Pokémon was no longer asleep. This fix adds an else condition to reset the frameRate to 12 if the sprite is already loaded upon resuming the game. Fixes #4465 --- src/data/pokemon-species.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index b710c40e1d5..469e400a551 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -484,6 +484,8 @@ export abstract class PokemonSpeciesForm { frameRate: 12, repeat: -1 }); + } else { + scene.anims.get(spriteKey).frameRate = 12; } let spritePath = this.getSpriteAtlasPath(female, formIndex, shiny, variant).replace("variant/", "").replace(/_[1-3]$/, ""); const useExpSprite = scene.experimentalSprites && scene.hasExpSprite(spriteKey);