Support non-int Enum types in the Lua API.

This commit is contained in:
Paul Chote
2018-11-04 10:55:28 +00:00
committed by reaperrr
parent d653614e75
commit 2064dc7c30
2 changed files with 14 additions and 1 deletions

View File

@@ -79,6 +79,18 @@ namespace OpenRA.Scripting
return true;
}
if (value is LuaNumber && t.IsAssignableFrom(typeof(short)))
{
clrObject = (short)value.ToNumber().Value;
return true;
}
if (value is LuaNumber && t.IsAssignableFrom(typeof(byte)))
{
clrObject = (byte)value.ToNumber().Value;
return true;
}
if (value is LuaString && t.IsAssignableFrom(typeof(string)))
{
clrObject = value.ToString();