mixins: Prevent runScript from being called recursively

Due to the extensive use of globals in the ScriptVM it is not reentrant
This commit is contained in:
Max Weber
2018-07-24 18:24:10 -06:00
parent 23c13c1d53
commit 87bf71c1ff

View File

@@ -130,6 +130,7 @@ public abstract class ScriptVMMixin implements RSClient
public void runScript(int id, Object... args)
{
assert isClientThread();
assert currentScript == null;
Object[] cargs = new Object[args.length + 1];
cargs[0] = id;
System.arraycopy(args, 0, cargs, 1, args.length);