From 1656242563d14fa564bab8d4bc40054ab8998553 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 27 Feb 2021 12:05:45 -0500 Subject: Added background music (defined on a per-map basis) --- res/scripts/common.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'res/scripts/common.lua') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 2a51419..a5e7873 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -260,7 +260,13 @@ function ChangeMap(map, warp, options) FadeToBlack(150) end loadMap(map) - character():transplantParty(playerId, getWarpPoint(warp), direction) + character():transplantParty(playerId, getMap():getWarpPoint(warp), direction) + + if (mixer():isPlayingMusic() and not getMap():hasMusic()) then + mixer():fadeoutMusic(150) + elseif (getMap():hasMusic() and (not mixer():isPlayingMusic() or not mixer():getPlayingTrack() == getMap():getMusic())) then + mixer():playMusic(getMap():getMusic(), 150) + end coroutine.yield() if (options & ChangeMapOptions.DO_NOT_FADE == 0) then -- cgit 1.4.1