Skip to content

Commit

Permalink
fix endless loop when now data is present an newest patch is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Himyu committed Nov 15, 2022
1 parent 3fe0c7a commit 9a51cd6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions StaticData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class StaticData {
private _finishedAdditionalFileDownloading = false
private _finishedDragonTail = false

public version: string
public version?: string

private versionIndex = 0

Expand All @@ -29,13 +29,14 @@ export default class StaticData {
* @param config
*/
constructor(private ctx: IPluginContext, private config: any) {
this.version = this.config.gameVersion
this._startUp()
}

private async _startUp() {
if (!this.version) {
if (!this.config.gameVersion) {
await this.setCurrentVersion()
} else {
this.version = this.config.gameVersion
}

if (
Expand Down Expand Up @@ -384,7 +385,7 @@ export default class StaticData {

const filePath = join(base, 'item.bin.json')

const versionSplit = this.version.split('.')
const versionSplit = (this.version as string).split('.')
const mainVersion = `${versionSplit[0]}.${versionSplit[1]}`
const uri = `https://raw.communitydragon.org/${mainVersion}/game/global/items/items.bin.json`
const res = await fetch(uri)
Expand Down

0 comments on commit 9a51cd6

Please sign in to comment.