From c517b26ac559356650334a2d32d1b6249e66289d Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 13 Jul 2019 17:56:23 +0200 Subject: Fix indexing bug --- backends/lua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends') diff --git a/backends/lua.c b/backends/lua.c index 08d8d3c..7f0c2de 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -341,7 +341,7 @@ static int lua_set(instance* inst, size_t num, channel** c, channel_value* v){ for(n = 0; n < num; n++){ data->input[c[n]->ident] = v[n].normalised; //call lua channel handlers if present - if(data->reference[n] != LUA_NOREF){ + if(data->reference[c[n]->ident] != LUA_NOREF){ lua_rawgeti(data->interpreter, LUA_REGISTRYINDEX, data->reference[c[n]->ident]); lua_pushnumber(data->interpreter, v[n].normalised); if(lua_pcall(data->interpreter, 1, 0, 0) != LUA_OK){ -- cgit v1.2.3