Skip to content

Commit

Permalink
Merge branch 'epp-rework-blueprinthookmanager' into epp-extend-bluepr…
Browse files Browse the repository at this point in the history
…inthookhelper
  • Loading branch information
Epp-code committed Nov 28, 2024
2 parents b18a672 + 55e717f commit 189d8ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Mods/SML/Source/SML/Private/Patching/BlueprintHookManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ void UBlueprintHookManager::InstallBlueprintHook(UFunction* Function, const int3
#endif

// Will assert if the resolved hook offset is not at properly-aligned, parseable statement
int32 OutStatementLength;
FSMLKismetBytecodeDisassembler Disassembler;
Disassembler.GetStatementLength(Function, ResolvedHookOffset, OutStatementLength);
int32 OutStatementLength;
fgcheckf(
Disassembler.GetStatementLength(Function, ResolvedHookOffset, OutStatementLength),
TEXT("Cannot install a blueprint hook at the requested hook offset, as it is not aligned with the beginning of a statement within the target function.") );

// First we go over the existing code and add UBlueprintHookManager::JumpBytesRequired to all
// the offsets. Afterwards we will move the relevant code and add the jump. Doing it in this
Expand Down

0 comments on commit 189d8ea

Please sign in to comment.