Browse Source

Add: status check

AnnulusGames 1 year ago
parent
commit
76fe4cec07
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Lua/LuaThread.cs

+ 4 - 0
src/Lua/LuaThread.cs

@@ -37,6 +37,10 @@ public sealed class LuaThread
                 throw new InvalidOperationException("cannot resume dead coroutine");
             }
         }
+        else if (status is LuaThreadStatus.Running)
+        {
+            throw new InvalidOperationException("cannot resume running coroutine");
+        }
 
         if (status is LuaThreadStatus.Normal)
         {