Add lua support for nullables

This commit is contained in:
abcdefg30
2015-05-20 16:37:46 +02:00
parent 9ec7f00635
commit 852ea87daa

View File

@@ -37,6 +37,12 @@ namespace OpenRA.Scripting
{ {
object temp; 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 // Value wraps a CLR object
if (value.TryGetClrObject(out temp)) if (value.TryGetClrObject(out temp))
{ {