Hi,
I’m attempting to call a function inside a function and return the return value of that inner function. I’ve had a search but couldn’t find the correct syntax to do this, I’m relatively new to C++ and I think this is likely to be something rather basic but I cannot find it anywhere.
The code below returns an empty FGameplayAbilitySpecHandle, which isn’t surprising as I don’t think it’s taking the return value for GiveAbility and is just returning a null value. How would I go about getting the return value from GiveAbility in order to return it from the outer GiveAbility function in this situation? (I have just realised the naming has made this more confusing)
FGameplayAbilitySpecHandle AGASPlayerState::GiveAbility(class TSubclassOf<UGASGameplayAbility> NewAbility)
{
if (HasAuthority() && AbilitySystemComponent)
{
AbilitySystemComponent->GiveAbility(
FGameplayAbilitySpec(NewAbility, 1, static_cast<int32>(NewAbility.GetDefaultObject()->AbilityInputID), this));
return FGameplayAbilitySpecHandle();
}
else return FGameplayAbilitySpecHandle();
}