Skip to content

Commit

Permalink
Fix persisting sleep animation when sprite is already loaded
Browse files Browse the repository at this point in the history
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
  • Loading branch information
acelynnzhang committed Oct 3, 2024
1 parent f634b7c commit d5ffe03
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/data/pokemon-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d5ffe03

Please sign in to comment.