From ee8bf3b4a30141fde2b29f9cbc82a83d9a67442e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Sun, 26 Apr 2015 21:38:04 +0200 Subject: [PATCH] Fixed music restarting on startMusic, even when the same key was used --- src/app/view/common/Audio.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/view/common/Audio.ts b/src/app/view/common/Audio.ts index 9f7d018..2a013fa 100644 --- a/src/app/view/common/Audio.ts +++ b/src/app/view/common/Audio.ts @@ -27,12 +27,13 @@ module SpaceTac.View { // Start a background music startMusic(key: string): void { + key = "music-" + key; if (this.isActive()) { if (this.music && this.music.key !== key) { this.stopMusic(); } if (!this.music) { - this.music = this.game.sound.play("music-" + key, 1, true); + this.music = this.game.sound.play(key, 1, true); } } }