in a instance ge, for example heal hp ge, mmc calc a heal number in Spec.Modifiers, but number not be updated to Spec.ModifiedAttributes, as a result, in this ge’s predict gc, it cannot get the number from Spec.ModifiedAttributes, so it cannot predict show the heal number.
i found the code to update Spec.ModifiedAttributes in predict:
FActiveGameplayEffect* FActiveGameplayEffectsContainer::ApplyGameplayEffectSpec(const FGameplayEffectSpec& Spec, FPredictionKey& InPredictionKey, bool& bFoundExistingStackableGE)
{
//...
// Build ModifiedAttribute list so GCs can have magnitude info if non-period effect
// Note: One day may want to not call gameplay cues unless ongoing tag requirements are met (will need to move this there)
{
const bool HasModifiedAttributes = AppliedEffectSpec.ModifiedAttributes.Num() > 0;
const bool HasDurationAndNoPeriod = AppliedEffectSpec.Def->DurationPolicy == EGameplayEffectDurationType::HasDuration && AppliedEffectSpec.GetPeriod() == UGameplayEffect::NO_PERIOD;
const bool HasPeriodAndNoDuration = AppliedEffectSpec.Def->DurationPolicy == EGameplayEffectDurationType::Instant &&
AppliedEffectSpec.GetPeriod() > UGameplayEffect::NO_PERIOD;
const bool ShouldBuildModifiedAttributeList = !HasModifiedAttributes && (HasDurationAndNoPeriod || HasPeriodAndNoDuration);
if (ShouldBuildModifiedAttributeList)
{
// update ModifiedAttribute
}
}
but the condition const bool HasPeriodAndNoDuration = AppliedEffectSpec.Def->DurationPolicy == EGameplayEffectDurationType::Instant && AppliedEffectSpec.GetPeriod() > UGameplayEffect::NO_PERIOD;
should never be met? why a ge is instance and it has period at the same time?