In my lua script, I set a variable x to equal a value:
Code: Select all
x = 3
Code: Select all
lua_getglobal(m_luaState, "x")
g_console->WriteLine("x: %d", lua_tonumber(m_luaState, -1));
Code: Select all
x: -16
Any ideas?
EDIT: Disregard this. I had -Wno-format set so I wasn't warned about using %d in my WriteLine call when I should've been using %f.