Skip to content

Commit c119443

Browse files
committed
Fix oms_setBoolean (#1366)
1 parent 6dfd41f commit c119443

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/OMSimulatorLua/OMSimulatorLua.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,16 +797,16 @@ static int OMSimulatorLua_oms_getSolver(lua_State *L)
797797
return 2;
798798
}
799799

800-
//oms_status_enu_t oms_setBoolean(const char* cref, double* value);
800+
//oms_status_enu_t oms_setBoolean(const char* cref, bool value);
801801
static int OMSimulatorLua_oms_setBoolean(lua_State *L)
802802
{
803803
if (lua_gettop(L) != 2)
804804
return luaL_error(L, "expecting exactly 2 arguments");
805805
luaL_checktype(L, 1, LUA_TSTRING);
806-
luaL_checktype(L, 2, LUA_TNUMBER);
806+
luaL_checktype(L, 2, LUA_TBOOLEAN);
807807

808808
const char* cref = lua_tostring(L, 1);
809-
bool value = lua_tointeger(L, 2);
809+
bool value = lua_toboolean(L, 2);
810810

811811
oms_status_enu_t status = oms_setBoolean(cref, value);
812812
lua_pushinteger(L, status);

0 commit comments

Comments
 (0)