raider3.5
raider3.5 copied to clipboard
Vectors should be made private
The UFunctionHooks::toHook and UFunctionHooks::toCall vectors should be made private, since they are implementation details of the UFunctionHooks namespace and should not be accessed directly by external code. Just a heads up kinda!
THIS IS LOCATED IN UFunctionHooks
#define DEFINE_PEHOOK(ufunctionName, func) \
toHook.push_back(UObject::FindObject<UFunction>(ufunctionName)); \
toCall.push_back([](UObject * Object, void* Parameters) -> bool func);
auto Initialize()
{
DEFINE_PEHOOK("Function GameplayAbilities.AbilitySystemComponent.ServerTryActivateAbility", {
auto AbilitySystemComponent = (UAbilitySystemComponent*)Object;
auto Params = (UAbilitySystemComponent_ServerTryActivateAbility_Params*)Parameters;
Abilities::TryActivateAbility(AbilitySystemComponent, Params->AbilityToActivate, Params->InputPressed, &Params->PredictionKey, nullptr);
return false;
})