[Refactor] Minor cleanup of initExpKeys (#6127)

This commit is contained in:
Bertie690 2025-07-25 19:39:25 -04:00 committed by GitHub
parent 7b7edbb474
commit ab394db9cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -699,16 +699,16 @@ export class BattleScene extends SceneBase {
if (expSpriteKeys.size > 0) {
return;
}
this.cachedFetch("./exp-sprites.json")
.then(res => res.json())
.then(keys => {
if (Array.isArray(keys)) {
for (const key of keys) {
expSpriteKeys.add(key);
}
}
Promise.resolve();
});
const res = await this.cachedFetch("./exp-sprites.json");
const keys = await res.json();
if (!Array.isArray(keys)) {
throw new Error("EXP Sprites were not array when fetched!");
}
// TODO: Optimize this
for (const k of keys) {
expSpriteKeys.add(k);
}
}
/**