Skip to content

Commit

Permalink
Added 'HookAActorTick' to UE4SS-settings.ini
Browse files Browse the repository at this point in the history
We've had the ability to hook AActor::Tick for a while now, but we never actually made use of this hook.
If Re-UE4SS/UEPseudo#83 is merged, then this won't come with any performance penalties unless a C++ mod decides that they want to register an AActor::Tick hook.
  • Loading branch information
UE4SS authored and narknon committed Mar 26, 2024
1 parent da247ed commit b5e6483
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions UE4SS/include/SettingsManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ namespace RC
bool HookCallFunctionByNameWithArguments{true};
bool HookBeginPlay{true};
bool HookLocalPlayerExec{true};
bool HookAActorTick{true};
int64_t FExecVTableOffsetInLocalPlayer{0x28};
} Hooks;

Expand Down
1 change: 1 addition & 0 deletions UE4SS/src/SettingsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ namespace RC
REGISTER_BOOL_SETTING(Hooks.HookCallFunctionByNameWithArguments, section_hooks, HookCallFunctionByNameWithArguments)
REGISTER_BOOL_SETTING(Hooks.HookBeginPlay, section_hooks, HookBeginPlay)
REGISTER_BOOL_SETTING(Hooks.HookLocalPlayerExec, section_hooks, HookLocalPlayerExec)
REGISTER_BOOL_SETTING(Hooks.HookAActorTick, section_hooks, HookAActorTick)
REGISTER_INT64_SETTING(Hooks.FExecVTableOffsetInLocalPlayer, section_hooks, FExecVTableOffsetInLocalPlayer)

constexpr static File::CharType section_experimental_features[] = STR("ExperimentalFeatures");
Expand Down
1 change: 1 addition & 0 deletions UE4SS/src/UE4SSProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ namespace RC
config.bHookCallFunctionByNameWithArguments = settings_manager.Hooks.HookCallFunctionByNameWithArguments;
config.bHookBeginPlay = settings_manager.Hooks.HookBeginPlay;
config.bHookLocalPlayerExec = settings_manager.Hooks.HookLocalPlayerExec;
config.bHookAActorTick = settings_manager.Hooks.HookAActorTick;
config.FExecVTableOffsetInLocalPlayer = settings_manager.Hooks.FExecVTableOffsetInLocalPlayer;

Unreal::UnrealInitializer::Initialize(config);
Expand Down
1 change: 1 addition & 0 deletions assets/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Fixed `FText` not working as a parameter (in `RegisterHook`, etc.).
```
[Hooks]
HookLoadMap = 1
HookAActorTick = 1
```

### Removed
Expand Down
1 change: 1 addition & 0 deletions assets/UE4SS-settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ HookLoadMap = 1
HookCallFunctionByNameWithArguments = 1
HookBeginPlay = 1
HookLocalPlayerExec = 1
HookAActorTick = 1
FExecVTableOffsetInLocalPlayer = 0x28

[CrashDump]
Expand Down

0 comments on commit b5e6483

Please sign in to comment.