From ff785c5c5a300d01b404c48335de7f68ad8711a9 Mon Sep 17 00:00:00 2001 From: cbdev Date: Fri, 24 Apr 2020 00:18:36 +0200 Subject: Update lua documentation, keep last value for handler --- backends/lua.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backends/lua.c') diff --git a/backends/lua.c b/backends/lua.c index d7f2643..98ce369 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -517,7 +517,6 @@ static int lua_set(instance* inst, size_t num, channel** c, channel_value* v){ //handle all incoming events for(n = 0; n < num; n++){ ident = c[n]->ident; - data->channel[ident].in = v[n].normalised; //call lua channel handlers if present if(data->channel[ident].reference != LUA_NOREF){ //push the channel name @@ -532,6 +531,8 @@ static int lua_set(instance* inst, size_t num, channel** c, channel_value* v){ lua_pop(data->interpreter, 1); } } + //update the channel input value after the handler call, so we can use both values there + data->channel[ident].in = v[n].normalised; } //clear the channel name -- cgit v1.2.3