第一次提交
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
|
||||
#include "AbilitySystem/Effects/GCS_GEComponent_PredictivelyExecute.h"
|
||||
|
||||
#include "GameplayEffect.h"
|
||||
#include "GCS_LogChannels.h"
|
||||
#include "Utility/GCS_CombatFunctionLibrary.h"
|
||||
|
||||
void UGCS_GEComponent_PredictivelyExecute::OnGameplayEffectApplied(FActiveGameplayEffectsContainer& ActiveGEContainer, FGameplayEffectSpec& GESpec, FPredictionKey& PredictionKey) const
|
||||
{
|
||||
FGCS_ContextPayload_Combat* Payload = UGCS_CombatFunctionLibrary::EffectContextGetMutableCombatPayload(GESpec.GetEffectContext());
|
||||
|
||||
if (Payload)
|
||||
{
|
||||
Payload->PredictionKey = PredictionKey;
|
||||
}
|
||||
|
||||
if (GESpec.GetEffectContext().GetInstigator()->GetLocalRole() == ROLE_AutonomousProxy)
|
||||
{
|
||||
if (Payload)
|
||||
{
|
||||
Payload->bIsPredictingContext = true;
|
||||
}
|
||||
GCS_LOG(Verbose, "Ctx:%s %s predictively execute:%s", *GetClientServerContextString(GESpec.GetEffectContext().GetInstigator()), *GetNameSafe(GESpec.GetEffectContext().GetInstigator()),
|
||||
*GetNameSafe(GESpec.Def))
|
||||
ActiveGEContainer.PredictivelyExecuteEffectSpec(GESpec, PredictionKey, bPredictGameplayCues);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user