Add workaround for crash with static variant sprites

pull/317/head
Flashfyre 2024-04-27 00:54:10 -04:00
parent 03ba74844f
commit 014c13b95b
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import { Biome } from "./data/enums/biome";
import { Arena, ArenaBase } from './field/arena'; import { Arena, ArenaBase } from './field/arena';
import { GameData, PlayerGender } from './system/game-data'; import { GameData, PlayerGender } from './system/game-data';
import StarterSelectUiHandler from './ui/starter-select-ui-handler'; import StarterSelectUiHandler from './ui/starter-select-ui-handler';
import { TextStyle, addBBCodeTextObject, addTextObject } from './ui/text'; import { TextStyle, addTextObject } from './ui/text';
import { Moves } from "./data/enums/moves"; import { Moves } from "./data/enums/moves";
import { allMoves } from "./data/move"; import { allMoves } from "./data/move";
import { initMoves } from './data/move'; import { initMoves } from './data/move';
@ -249,7 +249,7 @@ export default class BattleScene extends SceneBase {
loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) { loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) {
if (experimental === undefined) if (experimental === undefined)
experimental = this.experimentalSprites; experimental = this.experimentalSprites;
let variant = atlasPath.includes('variant/'); let variant = atlasPath.includes('variant/') || /_[0-3]$/.test(atlasPath);
if (experimental) if (experimental)
experimental = this.hasExpSprite(key); experimental = this.hasExpSprite(key);
if (variant) if (variant)