Check Against OK status

This commit is contained in:
Benjamin Odom 2024-05-17 20:50:11 -05:00
parent 79f43194c2
commit 3536618deb

View File

@ -332,8 +332,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.scene.cachedFetch(`./images/pokemon/variant/${useExpSprite ? 'exp/' : ''}${battleSpritePath}.json`).
then(res => {
// Prevent the JSON from processing if it failed to load
if (res.status === 404) {
console.error(`Could not load ${res.url}!`)
if (!res.ok) {
console.error(`Could not load ${res.url}!`);
return;
}
res.json()