Skip to content

Commit c1ea968

Browse files
add method yielding for safety
1 parent 7b6e9c0 commit c1ea968

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Code/ContextSystem/Contexts/MethodContext.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
using SER.Code.ArgumentSystem;
1+
using MEC;
2+
using SER.Code.ArgumentSystem;
23
using SER.Code.ContextSystem.BaseContexts;
34
using SER.Code.ContextSystem.Interfaces;
45
using SER.Code.ContextSystem.Structures;
56
using SER.Code.Helpers;
67
using SER.Code.Helpers.Extensions;
78
using SER.Code.Helpers.ResultSystem;
89
using SER.Code.MethodSystem.BaseMethods;
10+
using SER.Code.Plugin;
911
using SER.Code.TokenSystem.Tokens;
1012
using SER.Code.ValueSystem;
1113
using MethodToken = SER.Code.TokenSystem.Tokens.MethodToken;
@@ -56,6 +58,11 @@ protected override IEnumerator<float> Execute()
5658
{
5759
Log.Debug($"'{Method.Name}' method is now running..");
5860

61+
if (MainPlugin.Instance.Config?.SafeScripts is true)
62+
{
63+
yield return Timing.WaitForOneFrame;
64+
}
65+
5966
switch (Method)
6067
{
6168
case SynchronousMethod stdAct:

0 commit comments

Comments
 (0)