Skip to content

Commit 204b0bd

Browse files
committed
fix(Lua): NotifyOnNewObject broke from #1054
1 parent 96c34c5 commit 204b0bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

UE4SS/src/Mod/LuaMod.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,15 +2255,14 @@ No overload found for function 'NotifyOnNewObject'.
22552255
}
22562256

22572257
auto mod = get_mod_ref(lua);
2258-
auto hook_lua = get_hook_lua(mod);
2258+
auto [hook_lua, thread_ref] = make_hook_state(mod);
22592259

22602260
// Duplicate the Lua function to the top of the stack for lua_xmove and luaL_ref
22612261
lua_pushvalue(lua.get_lua_state(), 1);
22622262

22632263
lua_xmove(lua.get_lua_state(), hook_lua->get_lua_state(), 1);
22642264

22652265
const auto func_ref = hook_lua->registry().make_ref();
2266-
const auto thread_ref = mod->lua().registry().make_ref();
22672266

22682267
Unreal::UClass* instance_of_class = Unreal::UObjectGlobals::StaticFindObject<Unreal::UClass*>(nullptr, nullptr, class_name);
22692268

0 commit comments

Comments
 (0)