Ok, I did some digging and it comes back to the same problem I was having with retrieving the time remaining in cooldown/total cooldown.
It appears as though in the current code for 4.7, the only way to get a pointer to the instanced ability is if it is instanced per execution:
// If we are the server or this is a client authoritative
if (Ability->GetNetExecutionPolicy() == EGameplayAbilityNetExecutionPolicy::Client || (NetMode == ROLE_Authority))
// Create instance of this ability if necessary
if (Ability->GetInstancingPolicy() == EGameplayAbilityInstancingPolicy::InstancedPerExecution)
InstancedAbility = CreateNewInstanceOfAbility(*Spec, Ability);
ActivationInfo.bCanBeEndedByOtherInstance = Ability->bServerRespectsRemoteAbilityCancelation;
InstancedAbility->CallActivateAbility(Handle, ActorInfo, ActivationInfo, OnGameplayAbilityEndedDelegate);
*OutInstancedAbility = InstancedAbility;
Ability->CallActivateAbility(Handle, ActorInfo, ActivationInfo, OnGameplayAbilityEndedDelegate);
So it looks like end ability is trying to grab that pointer to my ability that is instanced per actor and set some flags on it:
// Attempt to activate the ability (server side) and tell the client if it succeeded or failed.
if (TryActivateAbility(Handle, PredictionKey, &InstancedAbility))
//Client commands to end the ability that come in after this point are considered for this instance
//Only applies to instanced abilities
InstancedAbility->CurrentActivationInfo.bCanBeEndedByOtherInstance = true;
But it fails to get a pointer to the instanced ability, which causes this to fail:
void UAbilitySystemComponent::EndAbility(FGameplayAbilitySpecHandle AbilityToEnd)
FGameplayAbilitySpec* AbilitySpec = FindAbilitySpecFromHandle(AbilityToEnd);
if (AbilitySpec && AbilitySpec->Ability && AbilitySpec->IsActive() && AbilitySpec->ActivationInfo.bCanBeEndedByOtherInstance)
It looks like this is fixed in your master, but the changes haven’t been pushed to 4.7 yet.