Jump to content

Touch Stone "enablelightsdirty" callback sends nil to OnEnableLights


Bumber64
  • Fixed

On line 263 of prefabs/resurrectionstone.lua, the event listener for "enablelightsdirty" is set to call OnEnableLights. OnEnableLights takes a boolean as its second parameter, but the callback doesn't send one. As a result, whenever inst._enablelights changes, the touch stone stops listening for player ghost vision regardless of inst._enablelights:value(), and will never re-enable the lights until the player logs out and rejoins while inst._enablelights:value() == true (i.e., while the touch stone is not busy reforming.)

The fix should be as simple as treating nil as true and moving the inst._enablelights:value() check inside the function like:

local function OnEnableLights(inst, enablelights)
    if enablelights ~= false and inst._enablelights:value() then
        inst.OnEntitySleep = OnSleep
        inst.OnEntityWake = OnWake
        if not inst:IsAsleep() then
            OnWake(inst)
        end
    else
        inst.OnEntitySleep = nil
        inst.OnEntityWake = nil
        OnSleep(inst)
    end
end

Steps to Reproduce

Check prefabs/resurrectionstone.lua:263. Touch stone light may break if you're on the same shard when another player revives using it.




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...