From 1a80ad9f5efcff7266d8b33a3d5ec33a8f452fa9 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 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);