diff --git a/snd_music.lua b/snd_music.lua index 5fa246c..6566b74 100644 --- a/snd_music.lua +++ b/snd_music.lua @@ -88,6 +88,7 @@ local unitExceptions = include("Configs/snd_music_exception.lua") local spAreTeamsAllied = Spring.AreTeamsAllied +local spGetUnitRulesParam = Spring.GetUnitRulesParam local MOODS = {"peace", "war", "war2", "winning", "losing", "briefing", "victory", "defeat"} local moodPriorities = {peace=0, war=1, war2=2, winning=4, losing=4, briefing=10, victory=10, defeat=10, [""]=0} -- Determines which music moods will instantly interrupt others, and which will wait for playing track to finish @@ -407,6 +408,7 @@ end function widget:UnitDestroyed(unitID, unitDefID, teamID) if unitExceptions[unitDefID] then return end + if spGetUnitRulesParam(unitID, "wasMorphedTo") then return end local unitCost = UnitDefs[unitDefID].metalCost if spAreTeamsAllied(teamID or 0, myTeam) then