From d2b65ffde425faf915151d0f0aa52e9989951fe4 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Fri, 1 Aug 2025 20:47:22 -0500 Subject: [PATCH] add luafunction pointer to pushvalue --- wrapper.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wrapper.go b/wrapper.go index 1147a59..877bf71 100644 --- a/wrapper.go +++ b/wrapper.go @@ -207,6 +207,12 @@ func (s *State) PushValue(v any) error { s.PushString(val) case GoFunction: return s.PushGoFunction(val) + case *LuaFunction: + C.lua_rawgeti(s.L, C.LUA_REGISTRYINDEX, C.int(val.ref)) + if val.ref == C.LUA_NOREF || val.ref == C.LUA_REFNIL { + s.Pop(1) + s.PushNil() + } case []int: return s.pushIntSlice(val) case []string: