mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-07 07:59:26 +02:00
[Refactor] Minor cleanup of initExpKeys
(#6127)
This commit is contained in:
parent
7b7edbb474
commit
ab394db9cf
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user