@@ -117,7 +117,20 @@ namespace RC
117117 bool has_return_value{};
118118 // Will be non-nullptr if the UFunction has a return value
119119 Unreal::FProperty* return_property{};
120- std::atomic<bool > scheduled_for_removal{};
120+ std::atomic<bool > scheduled_for_removal{false };
121+
122+ LuaUnrealScriptFunctionData (Unreal::CallbackId pre_id,
123+ Unreal::CallbackId post_id,
124+ Unreal::UFunction* func,
125+ const Mod* m,
126+ const LuaMadeSimple::Lua& l,
127+ int cb_ref,
128+ int post_cb_ref,
129+ int thread_ref)
130+ : pre_callback_id(pre_id), post_callback_id(post_id), unreal_function(func), mod(m), lua(l),
131+ lua_callback_ref (cb_ref), lua_post_callback_ref(post_cb_ref), lua_thread_ref(thread_ref)
132+ {
133+ }
121134 };
122135 static std::vector<std::unique_ptr<LuaUnrealScriptFunctionData>> g_hooked_script_function_data{};
123136
@@ -3650,7 +3663,7 @@ No overload found for function 'RegisterHook'.
36503663 unreal_function->HasAnyFunctionFlags (Unreal::EFunctionFlags::FUNC_Native))
36513664 {
36523665 auto & custom_data = g_hooked_script_function_data.emplace_back (std::make_unique<LuaUnrealScriptFunctionData>(
3653- LuaUnrealScriptFunctionData{ 0 , 0 , unreal_function, mod, *hook_lua, lua_callback_registry_index, lua_post_callback_registry_index, lua_thread_registry_index} ));
3666+ 0 , 0 , unreal_function, mod, *hook_lua, lua_callback_registry_index, lua_post_callback_registry_index, lua_thread_registry_index));
36543667 auto pre_id = unreal_function->RegisterPreHook (&lua_unreal_script_function_hook_pre, custom_data.get ());
36553668 auto post_id = unreal_function->RegisterPostHook (&lua_unreal_script_function_hook_post, custom_data.get ());
36563669 custom_data->pre_callback_id = pre_id;
0 commit comments