From ecb7c16751b83250cdee4963717b3c525f8a51fc Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Mon, 4 Apr 2022 13:21:51 +0100 Subject: [PATCH] Tweak handling of nullable types in LUA doc generation. The types for Int32 and Boolean are currently replaced with friendly names of int and bool for the docs. Ensure we apply the same handling when these are nullable types, changing the output from Int32? and Boolean? to int? and bool? --- OpenRA.Game/Scripting/ScriptMemberExts.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Scripting/ScriptMemberExts.cs b/OpenRA.Game/Scripting/ScriptMemberExts.cs index 80cee9865a..2fd8e019cf 100644 --- a/OpenRA.Game/Scripting/ScriptMemberExts.cs +++ b/OpenRA.Game/Scripting/ScriptMemberExts.cs @@ -32,7 +32,7 @@ namespace OpenRA.Scripting ret = t.Name; if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) - ret = $"{t.GetGenericArguments().Select(p => p.Name).First()}?"; + ret = $"{t.GetGenericArguments()[0].LuaDocString()}?"; return ret; }