diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index a6ec1662..021a7c8b 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -598,7 +598,6 @@ export class GameScene extends ResizableScene implements CenterListener { if (url === undefined) { audioManager.unloadAudio(); } else { - const mapDirUrl = this.MapUrlFile.substr(0, this.MapUrlFile.lastIndexOf('/')); const audioPath = url as string; let realAudioPath = ''; @@ -607,9 +606,10 @@ export class GameScene extends ResizableScene implements CenterListener { realAudioPath = audioPath; } else { // local file, include it relative to map directory + const mapDirUrl = this.MapUrlFile.substr(0, this.MapUrlFile.lastIndexOf('/')); realAudioPath = mapDirUrl + '/' + url; } - + audioManager.loadAudio(realAudioPath); if (loop) {