mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Fix ditto sprite not loading properly
This commit is contained in:
parent
0712f86462
commit
5d2a6743dc
@ -909,20 +909,24 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
const originalWarn = console.warn;
|
const originalWarn = console.warn;
|
||||||
// Ignore warnings for missing frames, because there will be a lot
|
// Ignore warnings for missing frames, because there will be a lot
|
||||||
console.warn = () => {};
|
console.warn = () => {};
|
||||||
const battleFrameNames = globalScene.anims.generateFrameNames(this.getBattleSpriteKey(), {
|
// NEED REVIEW: is `this.isPlayer()` always the correct check for whether to get the front of back sprite?
|
||||||
|
const battleSpriteKey = this.getBattleSpriteKey(this.isPlayer(), ignoreOverride);
|
||||||
|
const battleFrameNames = globalScene.anims.generateFrameNames(battleSpriteKey, {
|
||||||
zeroPad: 4,
|
zeroPad: 4,
|
||||||
suffix: ".png",
|
suffix: ".png",
|
||||||
start: 1,
|
start: 1,
|
||||||
end: 400,
|
end: 400,
|
||||||
});
|
});
|
||||||
console.warn = originalWarn;
|
console.warn = originalWarn;
|
||||||
|
if (!globalScene.anims.exists(battleSpriteKey)) {
|
||||||
globalScene.anims.create({
|
globalScene.anims.create({
|
||||||
key: this.getBattleSpriteKey(),
|
key: battleSpriteKey,
|
||||||
frames: battleFrameNames,
|
frames: battleFrameNames,
|
||||||
frameRate: 10,
|
frameRate: 10,
|
||||||
repeat: -1,
|
repeat: -1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// With everything loaded, now begin playing the animation.
|
// With everything loaded, now begin playing the animation.
|
||||||
this.playAnim();
|
this.playAnim();
|
||||||
|
|
||||||
|
@ -1110,7 +1110,7 @@ export class GameData {
|
|||||||
for (const p of sessionData.party) {
|
for (const p of sessionData.party) {
|
||||||
const pokemon = p.toPokemon() as PlayerPokemon;
|
const pokemon = p.toPokemon() as PlayerPokemon;
|
||||||
pokemon.setVisible(false);
|
pokemon.setVisible(false);
|
||||||
loadPokemonAssets.push(pokemon.loadAssets());
|
loadPokemonAssets.push(pokemon.loadAssets(false));
|
||||||
party.push(pokemon);
|
party.push(pokemon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user