bjorn 8 năm trước cách đây
mục cha
commit
efebbf8650
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      rx.lua

+ 5 - 5
rx.lua

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