From d5ffe0315a9dda5070f3a5461bb0df623365150e Mon Sep 17 00:00:00 2001 From: Acelynn Zhang Date: Thu, 3 Oct 2024 00:27:11 -0500 Subject: [PATCH] Fix persisting sleep animation when sprite is already loaded 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 b710c40e1d56..469e400a5515 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);