Fixed initTable warnings about missing properties

The Lua extension would report missing/uninitialized fields on actor creation because it thought they were required. This makes them all optional, except for OwnerInit, which is special.
This commit is contained in:
Pavel Penev
2023-10-06 11:53:15 +03:00
committed by Matthias Mailänder
parent 68d053336b
commit 74df2d22da

View File

@@ -149,7 +149,13 @@ namespace OpenRA.Mods.Common.UtilityCommands
.Distinct());
if (!string.IsNullOrEmpty(parameterString))
{
// OwnerInit is special as it is the only "required" init. All others are optional.
if (init.Name != nameof(OwnerInit))
parameterString += '?';
Console.WriteLine($"---@field {name} {parameterString}");
}
}
usedEnums = localEnums.Distinct();