Skip to content

Commit

Permalink
fix: potential minimap-related client crash
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanger committed Jul 17, 2023
1 parent 3932559 commit f08366e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/scripts/scenes/minimapScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class MinimapScene extends Phaser.Scene {
}

switchToBigMap(): void {
if (this.cameras.main === undefined) return;
if (this.cameras.main === undefined || this.fullScreenCamera === undefined) return;
this.fullScreenCamera.setVisible(true);
this.isExpanded = true;
this.resizeBigMap();
Expand All @@ -126,7 +126,7 @@ export class MinimapScene extends Phaser.Scene {
}

switchToSmallMap(): void {
if (this.cameras.main === undefined) return;
if (this.cameras.main === undefined || this.fullScreenCamera === undefined) return;
this.isExpanded = false;
this.fullScreenCamera.setVisible(false);
this.cameras.main.setVisible(this.visible);
Expand All @@ -135,7 +135,7 @@ export class MinimapScene extends Phaser.Scene {
}

updateTransparency(): void {
if (this.cameras.main === undefined) return;
if (this.cameras.main === undefined || this.fullScreenCamera === undefined) return;
this.cameras.main.setBackgroundColor({ ...GRASS_RGB, a: localStorageInstance.config.minimapTransparency * 255 });
this.cameras.main.setAlpha(localStorageInstance.config.minimapTransparency);
this.fullScreenCamera.setBackgroundColor({ ...GRASS_RGB, a: localStorageInstance.config.bigMapTransparency * 255 });
Expand Down

0 comments on commit f08366e

Please sign in to comment.