From 49e814cefacd612b243f85e4fe947b6b2e991f46 Mon Sep 17 00:00:00 2001 From: Dan Lihomanov Date: Tue, 29 Jun 2021 13:44:06 +0300 Subject: [PATCH] Fix Build Errors Added missing DeveloperSettings module in Abilities module Fixed UAbilitiesComponent::GetBuffCount function Changed old UProperty to FProperty --- Source/Abilities/Abilities.Build.cs | 3 ++- Source/Abilities/Private/Ability.cpp | 2 +- Source/Abilities/Private/Buff.cpp | 2 +- Source/Abilities/Public/AbilitiesComponent.h | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/Abilities/Abilities.Build.cs b/Source/Abilities/Abilities.Build.cs index e96cf02..4e7123e 100644 --- a/Source/Abilities/Abilities.Build.cs +++ b/Source/Abilities/Abilities.Build.cs @@ -16,7 +16,8 @@ public Abilities(ReadOnlyTargetRules Target) : base(Target) "Core", "CoreUObject", "Engine", - "GameplayTags" + "GameplayTags", + "DeveloperSettings" }); PrivateDependencyModuleNames.AddRange(new string[] {}); diff --git a/Source/Abilities/Private/Ability.cpp b/Source/Abilities/Private/Ability.cpp index 50464cf..a3579eb 100644 --- a/Source/Abilities/Private/Ability.cpp +++ b/Source/Abilities/Private/Ability.cpp @@ -443,7 +443,7 @@ void UAbility::PreDestroyFromReplication() } #if WITH_EDITOR -bool UAbility::CanEditChange(const UProperty* InProperty) const +bool UAbility::CanEditChange(const FProperty* InProperty) const { bool bCanEdit = Super::CanEditChange(InProperty); diff --git a/Source/Abilities/Private/Buff.cpp b/Source/Abilities/Private/Buff.cpp index 81dff0b..35e8955 100644 --- a/Source/Abilities/Private/Buff.cpp +++ b/Source/Abilities/Private/Buff.cpp @@ -4,7 +4,7 @@ #include "AbilitiesComponent.h" #if WITH_EDITOR -bool UBuff::CanEditChange(const UProperty* InProperty) const +bool UBuff::CanEditChange(const FProperty* InProperty) const { bool bCanEdit = Super::CanEditChange(InProperty); diff --git a/Source/Abilities/Public/AbilitiesComponent.h b/Source/Abilities/Public/AbilitiesComponent.h index fd55d4c..1e75f7e 100644 --- a/Source/Abilities/Public/AbilitiesComponent.h +++ b/Source/Abilities/Public/AbilitiesComponent.h @@ -469,7 +469,9 @@ inline bool UAbilitiesComponent::HasAuthority() const inline int32 UAbilitiesComponent::GetBuffCount(const UBuff* Buff) const { - if (const auto* BuffCount = Buffs.Find(Buff)) + FBuffCount SearchBuff = FBuffCount(const_cast(Buff), 1); + const FBuffCount* BuffCount = Buffs.Find(SearchBuff); + if (BuffCount != NULL) { return BuffCount->Count; }