raider3.5 icon indicating copy to clipboard operation
raider3.5 copied to clipboard

Vectors should be made private

Open OperativeA115 opened this issue 3 years ago • 0 comments

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;
        })

OperativeA115 avatar Dec 06 '22 02:12 OperativeA115