From a9d7345e8ea6a9cabad8d8e421a5e2cf358005ed Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 24 Feb 2023 22:15:52 -0500 Subject: ffi: Reset arg index on each Lua->C function call --- (limited to 'src/scripting') diff --git a/src/scripting/ffi.c b/src/scripting/ffi.c index 6a30a94..35ba6f2 100644 --- a/src/scripting/ffi.c +++ b/src/scripting/ffi.c @@ -149,6 +149,8 @@ ffi_handle_function(lua_State *l) { struct ffi_function *fn; + call_arg_index = 0; + fn = (struct ffi_function *) lua_touserdata(l, lua_upvalueindex(1)); fn->func(fn); -- cgit v0.9.1