From 8d67947bc19db6a34a8552093e612b490bdcc6d9 Mon Sep 17 00:00:00 2001 From: psy Date: Thu, 14 Jan 2021 11:48:06 +0100 Subject: [PATCH] move map url to else case --- front/src/Phaser/Game/GameScene.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {