Skip to content

Commit

Permalink
Copy arguments when spawn()ing
Browse files Browse the repository at this point in the history
  • Loading branch information
wixoaGit committed May 10, 2022
1 parent c254fc2 commit 323acbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion OpenDreamRuntime/Procs/DMProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,16 @@ public DMProcState(DMProcState other, DreamThread thread)
_proc = other._proc;
Instance = other.Instance;
Usr = other.Usr;
Arguments = other.Arguments;
_pc = other._pc;

_stack = _stackPool.Rent(other._stack.Length);
Array.Copy(other._stack, _stack, _stack.Length);

LocalVariables = _dreamValuePool.Rent(256);
Array.Copy(other.LocalVariables, LocalVariables, 256);

Arguments = _dreamValuePool.Rent(other.Arguments.Length);
Array.Copy(other.Arguments, Arguments, other.Arguments.Length);
}

protected override ProcStatus InternalResume()
Expand Down

0 comments on commit 323acbb

Please sign in to comment.