move map url to else case
This commit is contained in:
parent
f431e769cc
commit
8d67947bc1
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user