From 5582a5c4be59eae09d8c483775022cfeb6f81b2b Mon Sep 17 00:00:00 2001 From: ike709 Date: Sun, 5 Apr 2026 01:40:01 -0500 Subject: [PATCH 1/2] Fix `world.GetConfig()` parity --- Content.Tests/DMProject/Tests/Builtins/world_config.dm | 2 +- OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Content.Tests/DMProject/Tests/Builtins/world_config.dm b/Content.Tests/DMProject/Tests/Builtins/world_config.dm index 6a2e77c639..2367bf53e3 100644 --- a/Content.Tests/DMProject/Tests/Builtins/world_config.dm +++ b/Content.Tests/DMProject/Tests/Builtins/world_config.dm @@ -17,4 +17,4 @@ world.SetConfig("env", env_var, env_value) world.SetConfig("env", env_var, 17) - ASSERT(world.GetConfig("env", env_var) == null) + ASSERT(world.GetConfig("env", env_var) == "") diff --git a/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs b/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs index fe91969015..f6b89518f7 100644 --- a/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs +++ b/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs @@ -98,11 +98,13 @@ public static DreamValue NativeProc_GetConfig(NativeProc.Bundle bundle, DreamObj // DM ref says: "If no parameter is specified, a list of the names of all available parameters is returned." // but apparently it's actually just null for "env". return DreamValue.Null; - } else if (param.TryGetValueAsString(out var paramString) && Environment.GetEnvironmentVariable(paramString) is string strValue) { + } + + if (param.TryGetValueAsString(out var paramString) && Environment.GetEnvironmentVariable(paramString) is string strValue) { return new DreamValue(strValue); - } else { - return DreamValue.Null; } + + return DreamValue.EmptyString; case "ban": case "keyban": case "ipban": From 0576abab19ff4d8054054279f534193c92cd3c0d Mon Sep 17 00:00:00 2001 From: ike709 Date: Sun, 5 Apr 2026 01:46:17 -0500 Subject: [PATCH 2/2] resharper --- OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs b/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs index f6b89518f7..9996fa558e 100644 --- a/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs +++ b/OpenDreamRuntime/Procs/Native/DreamProcNativeWorld.cs @@ -100,7 +100,7 @@ public static DreamValue NativeProc_GetConfig(NativeProc.Bundle bundle, DreamObj return DreamValue.Null; } - if (param.TryGetValueAsString(out var paramString) && Environment.GetEnvironmentVariable(paramString) is string strValue) { + if (param.TryGetValueAsString(out var paramString) && Environment.GetEnvironmentVariable(paramString) is { } strValue) { return new DreamValue(strValue); }