ScriptActorInterfaces, unbind on actor destroy.

This commit is contained in:
Vapre
2022-07-26 08:00:00 +02:00
committed by Matthias Mailänder
parent fc1d8d2355
commit 215898c7ec
5 changed files with 63 additions and 54 deletions

View File

@@ -61,30 +61,33 @@ namespace OpenRA.Scripting
return true;
}
if (value is LuaNumber && t.IsAssignableFrom(typeof(double)))
if (value is LuaNumber)
{
clrObject = value.ToNumber().Value;
return true;
}
if (t.IsAssignableFrom(typeof(double)))
{
clrObject = value.ToNumber().Value;
return true;
}
// Need an explicit test for double -> int
// TODO: Lua 5.3 will introduce an integer type, so this will be able to go away
if (value is LuaNumber && t.IsAssignableFrom(typeof(int)))
{
clrObject = (int)value.ToNumber().Value;
return true;
}
// Need an explicit test for double -> int
// TODO: Lua 5.3 will introduce an integer type, so this will be able to go away
if (t.IsAssignableFrom(typeof(int)))
{
clrObject = (int)value.ToNumber().Value;
return true;
}
if (value is LuaNumber && t.IsAssignableFrom(typeof(short)))
{
clrObject = (short)value.ToNumber().Value;
return true;
}
if (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 (t.IsAssignableFrom(typeof(byte)))
{
clrObject = (byte)value.ToNumber().Value;
return true;
}
}
if (value is LuaString && t.IsAssignableFrom(typeof(string)))