This commit is contained in:
bjorn 2017-05-07 23:12:26 -07:00
parent e5decf0ac8
commit efebbf8650

12
rx.lua
View File

@ -1871,14 +1871,14 @@ function CooperativeScheduler:update(delta)
if self.currentTime >= task.due then if self.currentTime >= task.due then
local success, delay = coroutine.resume(task.thread) local success, delay = coroutine.resume(task.thread)
if success then
task.due = math.max(task.due + (delay or 0), self.currentTime)
else
error(delay)
end
if coroutine.status(task.thread) == 'dead' then if coroutine.status(task.thread) == 'dead' then
table.remove(self.tasks, i) table.remove(self.tasks, i)
else
task.due = math.max(task.due + (delay or 0), self.currentTime)
end
if not success then
error(delay)
end end
end end
end end