We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6dfd41f commit c119443Copy full SHA for c119443
1 file changed
src/OMSimulatorLua/OMSimulatorLua.c
@@ -797,16 +797,16 @@ static int OMSimulatorLua_oms_getSolver(lua_State *L)
797
return 2;
798
}
799
800
-//oms_status_enu_t oms_setBoolean(const char* cref, double* value);
+//oms_status_enu_t oms_setBoolean(const char* cref, bool value);
801
static int OMSimulatorLua_oms_setBoolean(lua_State *L)
802
{
803
if (lua_gettop(L) != 2)
804
return luaL_error(L, "expecting exactly 2 arguments");
805
luaL_checktype(L, 1, LUA_TSTRING);
806
- luaL_checktype(L, 2, LUA_TNUMBER);
+ luaL_checktype(L, 2, LUA_TBOOLEAN);
807
808
const char* cref = lua_tostring(L, 1);
809
- bool value = lua_tointeger(L, 2);
+ bool value = lua_toboolean(L, 2);
810
811
oms_status_enu_t status = oms_setBoolean(cref, value);
812
lua_pushinteger(L, status);
0 commit comments