more fixing

This commit is contained in:
Nyx
2025-10-20 22:44:17 -06:00
parent cb2cc66cc0
commit 5b585da3a9
12 changed files with 22 additions and 18 deletions

View File

@@ -112,6 +112,6 @@ void ULevelAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCallb
SetLevel(static_cast<float>(Lvl));
SetXP(FMath::Clamp(GetXP(),0.0f,ComputeXPForLevel(Lvl)));
SetXPToNextLevel(ComputeXPForLevel(Lvl));
OnXPToNextLevelChanged.Broadcast(this, OldValue.GetCurrentValue(), XPToNextLevel.GetCurrentValue());
OnXPToNextLevelChanged.Broadcast(this, XPToNextLevel.GetCurrentValue(), XPToNextLevel.GetCurrentValue());
}
}

View File

@@ -45,7 +45,7 @@ void UStaminaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCal
if (OldStamina!=NewStamina)
{
SetStamina(NewStamina);
OnMaxStaminaChanged.Broadcast(this, OldMaxStamina, NewMaxStamina);
OnMaxStaminaChanged.Broadcast(this, OldStamina, NewStamina);
}
SetDrain(0.0f);
}
@@ -58,7 +58,7 @@ void UStaminaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCal
if (OldStamina!=NewStamina)
{
SetStamina(NewStamina);
OnMaxStaminaChanged.Broadcast(this, OldMaxStamina, NewMaxStamina);
OnMaxStaminaChanged.Broadcast(this, OldStamina, NewStamina);
}
}
}

View File

@@ -33,6 +33,7 @@ void AMagickPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& O
DOREPLIFETIME_CONDITION_NOTIFY(AMagickPlayerState, ManaSet, COND_None, REPNOTIFY_Always);
DOREPLIFETIME_CONDITION_NOTIFY(AMagickPlayerState, HealthSet, COND_None, REPNOTIFY_Always);
DOREPLIFETIME_CONDITION_NOTIFY(AMagickPlayerState, StaminaSet, COND_None, REPNOTIFY_Always);
DOREPLIFETIME_CONDITION_NOTIFY(AMagickPlayerState, LevelSet, COND_None, REPNOTIFY_Always);
}
void AMagickPlayerState::SetupAbilityActorInfo()

View File

@@ -9,8 +9,6 @@
/**
*
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FAttributeChangedEvent, UAttributeSet*, AttributeSet, float, OldValue,
float, NewValue);
#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \

View File

@@ -31,7 +31,7 @@ public:
void SetupAbilityActorInfo();
protected:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Abilities, Replicated)
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Abilities, ReplicatedUsing = OnRep_ElistriaAbilitySystemComponent)
TObjectPtr<class UElistriaAbilitySystemComponent> ElistriaAbilitySystemComponent;
UPROPERTY(Replicated)
@@ -46,6 +46,8 @@ protected:
UPROPERTY(Replicated)
TObjectPtr<ULevelAttributeSet> LevelSet;
UFUNCTION()
void OnRep_ElistriaAbilitySystemComponent();
private:
};