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`). this.scene.cachedFetch(`./images/pokemon/variant/${useExpSprite ? 'exp/' : ''}${battleSpritePath}.json`).
then(res => { then(res => {
// Prevent the JSON from processing if it failed to load // Prevent the JSON from processing if it failed to load
if (res.status === 404) { if (!res.ok) {
console.error(`Could not load ${res.url}!`) console.error(`Could not load ${res.url}!`);
return; return;
} }
res.json() res.json()