Jump to content

Busy music fails to play after respawning if it was playing on death


HalfEnder776
  • Fixed

If the player dies while busy music is still playing (no danger music replacing it) that specific busy music will not play when the player respawns until a different music starts.

I dont think this issue has been noticed before because usually, players die from sources that trigger danger music...

This is because the _busytheme variable in the dynamicmusic component is not cleared when dynamicmusic is disabled (which is done when the player dies) (however the deprecated _isbusydirty does get cleared...)

To fix this just clear _busytheme in OnEnableDynamicMusic:

local function OnEnableDynamicMusic(inst, enable)
    if _isenabled ~= enable then
        if not enable and _soundemitter ~= nil then
            StopDanger()
            StopBusy()
            _soundemitter:KillSound("busy")
            _busytheme = nil -- Add this line of code to fix the issue
            _isbusydirty = true
        end
        _isenabled = enable
    end
end

 

 

 


Steps to Reproduce

Die while busy music is still playing

Respawn and try to trigger that same busytheme

 

  • Like 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...