Skip to content

Commit

Permalink
fix: where onWorldLoaded is called to work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraviolet-jordan committed Jan 29, 2025
1 parent 19211c3 commit de18d03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ export class Game extends Client {
Client.oplogic7 = 0;
Client.oplogic8 = 0;
Client.oplogic9 = 0;
this.prepareGameScreen();
await this.prepareGameScreen();
return;
}
if (reply === 3) {
Expand Down Expand Up @@ -4556,7 +4556,7 @@ export class Game extends Client {
}
};

private prepareGameScreen = (): void => {
private prepareGameScreen = async (): Promise<void> => {
if (!this.areaChatback) {
this.unloadTitle();
this.drawArea = null;
Expand All @@ -4581,6 +4581,7 @@ export class Game extends Client {
this.areaBackhmid1 = new PixMap(269, 66);
this.redrawTitleBackground = true;
}
await this?.onWorldLoaded();
};

private isFriend = (username: string | null): boolean => {
Expand Down Expand Up @@ -6072,7 +6073,6 @@ export class Game extends Client {
this.sceneState = 2;
World.levelBuilt = this.currentLevel;
this.buildScene();
await this?.onWorldLoaded();
}
if (Client.lowMemory && this.sceneState === 2 && World.levelBuilt !== this.currentLevel) {
this.areaViewport?.bind();
Expand Down

0 comments on commit de18d03

Please sign in to comment.