Jump to content

Cant resume dead coroutine


h0x1

Recommended Posts

Posted

After update my server to build 1.5.1 7809 i saw this:

Resource bone_attach flooding errors in console(1 error per second)

ERROR: bone_attach/attach_func.lua:116: cannot resume dead coroutine [string "?"] 

Before the that flooding, i saw this error

ERROR: bone_attach/attach_func.lua:116: invalid key to 'next' [string "?"] 

Here is a function,errors in last line(116)

function forgetNonExistingPeds() 
    local checkedcount = 0 
    while true do 
        for element,ped in pairs(attached_ped) do 
            if not isElement(ped) then clearAttachmentData(element) end 
            checkedcount = checkedcount+1 
            if checkedcount >= 1000 then 
                coroutine.yield() 
                checkedcount = 0 
            end 
        end 
        coroutine.yield() 
    end 
end 
clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds) 
setTimer(function() coroutine.resume(clearing_nonexisting_peds) end,1000,0) 

Thanks for any support :)

Posted

The error "invalid key to 'next'" has given me such a hard time, but I found out that nothing goes wrong even though the error is there.

About the coroutine, are you sure that the coroutine is actually a correctly corrected thing? They are getting spammed since you got an infinite amount of times on your timer.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...