Lua returns wrong values

263 Views Asked by At

I've got the following scenario:

  1. I registered a c# function in nlua
  2. This function is called like this in the lua script: SomeFunction({Amount = 1})
  3. The c# function gets called but now the Amount is some arbitrary huge double

The code in which I register the function:

Lua LuaInterface = new Lua();
someFunction = (LuaTable t) => DoSomething(t);
LuaInterface.RegisterFunction("SomeFunction", someFunction.Target, someFunction.Method);

If I use the debugger, t is for example {{ Amount = -2,05689484611373E-178 }}

I've spent about two hours finding a bug in my code (the real one is far more complex) and this is just what I reduced the problem to.

0

There are 0 best solutions below