FPredictionKey FPredictionKey::CreateNewPredictionKey(UAbilitySystemComponent* OwningComponent) { FPredictionKey NewKey; // We should never generate prediction keys on the authority if(OwningComponent->GetOwnerRole() != ROLE_Authority) { NewKey.GenerateNewPredictionKey(); } return NewKey; }
FPredictionKey FPredictionKey::CreateNewServerInitiatedKey(UAbilitySystemComponent* OwningComponent) { FPredictionKey NewKey; // Only valid on the server if (OwningComponent->GetOwnerRole() == ROLE_Authority) { NewKey.GenerateNewPredictionKey(); NewKey.bIsServerInitiated = true; } return NewKey; }
void FActiveGameplayCueContainer::PredictiveAdd(const FGameplayTag& Tag, FPredictionKey& PredictionKey) { Owner->UpdateTagMap(Tag, 1); PredictionKey.NewRejectOrCaughtUpDelegate(FPredictionKeyEvent::CreateUObject(Owner, &UAbilitySystemComponent::OnPredictiveGameplayCueCatchup, Tag)); }
FPredictionKey FPredictionKey::CreateNewPredictionKey() { FPredictionKey NewKey; NewKey.GenerateNewPredictionKey(); return NewKey; }