From 37eb674d407cd76c1a8906b006095ac199f7bb9a Mon Sep 17 00:00:00 2001 From: jacob1 Date: Fri, 18 Dec 2015 18:21:04 -0500 Subject: [PATCH] fix being unable to set floating point values in element.property broken in e92bbac7001b --- src/lua/LuaScriptInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 3fd2801ea1..bcb3c095c3 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -2560,7 +2560,7 @@ int LuaScriptInterface::elements_property(lua_State * l) *((unsigned int*)(((unsigned char*)&luacon_sim->elements[id])+offset)) = luaL_checkinteger(l, 3); break; case StructProperty::Float: - *((float*)(((unsigned char*)&luacon_sim->elements[id])+offset)) = luaL_checkinteger(l, 3); + *((float*)(((unsigned char*)&luacon_sim->elements[id])+offset)) = luaL_checknumber(l, 3); break; case StructProperty::Char: *((char*)(((unsigned char*)&luacon_sim->elements[id])+offset)) = luaL_checkinteger(l, 3);