From 89e5ef9cff0ed2f2c0b90e39185e4680fdccf6ce Mon Sep 17 00:00:00 2001 From: rejuvenat0r Date: Wed, 7 Feb 2024 15:10:22 -0600 Subject: [PATCH] Fixes `.` in `spawn()` --- .../Tests/Statements/Control Flow/spawn_self_test.dm | 7 +++++++ OpenDreamRuntime/Procs/DMProc.cs | 1 + 2 files changed, 8 insertions(+) create mode 100644 Content.Tests/DMProject/Tests/Statements/Control Flow/spawn_self_test.dm diff --git a/Content.Tests/DMProject/Tests/Statements/Control Flow/spawn_self_test.dm b/Content.Tests/DMProject/Tests/Statements/Control Flow/spawn_self_test.dm new file mode 100644 index 0000000000..6f97ef09bd --- /dev/null +++ b/Content.Tests/DMProject/Tests/Statements/Control Flow/spawn_self_test.dm @@ -0,0 +1,7 @@ + +//# issue 1653 + +/proc/RunTest() + . = "foobar" + spawn(0) + ASSERT(. == "foobar") diff --git a/OpenDreamRuntime/Procs/DMProc.cs b/OpenDreamRuntime/Procs/DMProc.cs index e42feb8ee9..8ea4a62904 100644 --- a/OpenDreamRuntime/Procs/DMProc.cs +++ b/OpenDreamRuntime/Procs/DMProc.cs @@ -357,6 +357,7 @@ private DMProcState(DMProcState other, DreamThread thread) { ArgumentCount = other.ArgumentCount; _pc = other._pc; _firstResume = false; + Result = other.Result; _stack = _dreamValuePool.Rent(other._stack.Length); _localVariables = _dreamValuePool.Rent(other._localVariables.Length);