File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,8 @@ namespace RC
247247 // Fetch the data corresponding to this UFunction
248248 auto & lua_data = *static_cast <LuaUnrealScriptFunctionData*>(custom_data);
249249
250- auto remove_if_scheduled = [&] {
250+ // Returns true if a hooks were removed.
251+ auto remove_if_scheduled = [&] -> bool {
251252 if (lua_data.scheduled_for_removal )
252253 {
253254 const auto function_name_no_prefix = get_function_name_without_prefix (lua_data.unreal_function ->GetFullName ());
@@ -269,12 +270,19 @@ namespace RC
269270 return elem.get () == &lua_data;
270271 });
271272
272- return ;
273+ return true ;
274+ }
275+ else
276+ {
277+ return false ;
273278 }
274279 };
275280
276281 // Removes pre & post-hook callbacks if UnregisterHook was called in the pre-callback.
277- remove_if_scheduled ();
282+ if (remove_if_scheduled ())
283+ {
284+ return ;
285+ }
278286
279287 // This is a promise that we're in the game thread, used by other functions to ensure that we don't execute when unsafe
280288 set_is_in_game_thread (lua_data.lua , true );
You can’t perform that action at this time.
0 commit comments