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 @@ -232,7 +232,8 @@ namespace RC
232232 // Fetch the data corresponding to this UFunction
233233 auto & lua_data = *static_cast <LuaUnrealScriptFunctionData*>(custom_data);
234234
235- auto remove_if_scheduled = [&] {
235+ // Returns true if a hooks were removed.
236+ auto remove_if_scheduled = [&] -> bool {
236237 if (lua_data.scheduled_for_removal )
237238 {
238239 const auto function_name_no_prefix = get_function_name_without_prefix (lua_data.unreal_function ->GetFullName ());
@@ -254,12 +255,19 @@ namespace RC
254255 return elem.get () == &lua_data;
255256 });
256257
257- return ;
258+ return true ;
259+ }
260+ else
261+ {
262+ return false ;
258263 }
259264 };
260265
261266 // Removes pre & post-hook callbacks if UnregisterHook was called in the pre-callback.
262- remove_if_scheduled ();
267+ if (remove_if_scheduled ())
268+ {
269+ return ;
270+ }
263271
264272 auto process_return_value = [&]() {
265273 // If 'nil' exists on the Lua stack, that means that the UFunction expected a return value but the Lua script didn't return anything
You can’t perform that action at this time.
0 commit comments