b1142.2 obeyEMCOM property
Posted: Sat Apr 18, 2020 7:47 pm
Anyone figured out how to access this Boolean property correctly yet?
Code: Select all
local u = ScenEdit_GetUnit(guid='blalba');
u.obeyEMCOM = false; -- throws casting exception
print(tostring(u.obeyEMCOM)); -- throws casting exception.
print(u.obeyEMCOM); -- returns 'keralua.luafunction'
u.obeyEMCOM(false); -- invoke invalid method as expected.
casting exception:
System.InvalidCastException: Unable to cast object of type
'KeraLua.LuaFunction' to type 'System.Reflection.MemberInfo'.
at NLua.MetaFunctions.TrySetMember(Lua luaState,
ProxyType targetType, Object target, BindingFlags bindingType,
String& detailMessage)
at NLua.MetaFunctions.SetFieldOrPropertyInternal(Lua luaState)
at NLua.MetaFunctions.SetFieldOrProperty(IntPtr state)
at KeraLua.NativeMethods.lua_pcallk(IntPtr luaState, Int32 nargs,
Int32 nresults, Int32 errorfunc, IntPtr ctx, IntPtr k)
at NLua.Lua.DoString(String chunk, String chunkName)
at Command_Core.Lua.LuaSandBox.RunScript(String str,
Boolean RunInteractively, String script),nil