Fix persisting sleep animation when sprite is already loaded

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
This commit is contained in:
Acelynn Zhang 2024-10-03 00:27:11 -05:00 committed by Acelynn Zhang
parent af51c1f2f0
commit 1a80ad9f5e

View File

@ -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);