Jump to content

Flotsam Won't Despawn


PuffinBy
  • DLC VERSION - IMPORTANT!: Shipwrecked, Hamlet Pending

In prefabs/flotsam_basegame.lua line 94

local function OnTimer(inst, timerdata)
    if timerdata.name == "decay" then
        inst.components.flotsamfisher:DeltaFish(-1)
        if inst.components.flotsamfisher.lootleft > 0 then
            UpdateDebris(inst)
            inst.components.timer:StartTimer("decay", TUNING.FLOTSAM_DECAY_TIME)
        end
    end
end

In components/timer.lua line 29 and 148

local timerfn = function() self.inst:PushEvent("timerdone", {name = name}) self:StopTimer(name) end

"StopTimer" is called after "PushEvent", resulting "OnTimer" function in flotsam_basegame failing to "StartTimer", when the timer already exists.

Use inst:DoTaskInTime(0,function() inst.components.timer:StartTimer("decay",TUNING.FLOTSAM_DECAY_TIME) end ) instead will fix this.

 

FYI, timer component in basegame worked fine, since it pushed event after stopping timer. The Order must have been changed for some other reasons in dlc2&3, so I don't recommend modifying timer.lua.


Steps to Reproduce

Enable sw or hamlet, spawn a flotsam ingame, wait and see it never decays completely.




User Feedback




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