From 852ea87daae0e06666e365b6b85fd2eacde223db Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Wed, 20 May 2015 16:37:46 +0200 Subject: [PATCH] Add lua support for nullables --- OpenRA.Game/Scripting/ScriptTypes.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Game/Scripting/ScriptTypes.cs b/OpenRA.Game/Scripting/ScriptTypes.cs index dd5ec8fe20..14a792b7f6 100644 --- a/OpenRA.Game/Scripting/ScriptTypes.cs +++ b/OpenRA.Game/Scripting/ScriptTypes.cs @@ -37,6 +37,12 @@ namespace OpenRA.Scripting { object temp; + // Is t a nullable? + // If yes, get the underlying type + var nullable = Nullable.GetUnderlyingType(t); + if (nullable != null) + t = nullable; + // Value wraps a CLR object if (value.TryGetClrObject(out temp)) {