TASK模块创建任务第一次执行的时候也用assert保证错误被捕捉

This commit is contained in:
MrZ626
2021-11-01 03:23:00 +08:00
parent d75b709f23
commit 5535366bb1

View File

@@ -23,7 +23,7 @@ function TASK.update(dt)
end end
function TASK.new(code,...) function TASK.new(code,...)
local thread=coroutine.create(code) local thread=coroutine.create(code)
resume(thread,...) assert(resume(thread,...))
if status(thread)~='dead'then if status(thread)~='dead'then
tasks[#tasks+1]={ tasks[#tasks+1]={
thread=thread, thread=thread,