Skip to content

Commit

Permalink
Minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Jun 1, 2024
1 parent 8128bed commit 77f6e44
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/js/stendhal/util/WeatherRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ export class WeatherRenderer {
// reset warning messages
this.warned = {};

const soundMan = singletons.getSoundManager();
// stop previous sounds
// FIXME: should continue playing if weather is same on next map
if (this.audio) {
soundMan.stop(this.soundLayer, this.audio);
stendhal.sound.stop(this.soundLayer, this.audio);
this.audio = undefined;
}

Expand Down Expand Up @@ -137,8 +136,7 @@ export class WeatherRenderer {
this.tilesY = Math.ceil(canvas.height / spriteH) + 1;

if (weatherLoops[weather]) {
this.audio = soundMan.playGlobalizedLoop("weather/" + weather,
this.soundLayer);
this.audio = stendhal.sound.playGlobalizedLoop("weather/" + weather, this.soundLayer);
}
}
}
Expand Down

0 comments on commit 77f6e44

Please sign in to comment.