From 672abfa17ff4290f5b287fbc337ccbfbc221a2db Mon Sep 17 00:00:00 2001 From: gabriel pereyra Date: Fri, 12 Jan 2024 11:56:25 -0500 Subject: [PATCH] Gameplay Tag Manager: Adjusted the loop in "UGameplayTagsManager::StaticGetCategoriesMetaFromPropertyHandle" to break early if the outer base class of a child property and its parent are of a different type. This helps us avoid situations where a suboject's gameplay tag property may inherit meta categories from a different class it didn't expect and cause unintented restrictions on the child tag property. #rb ben.zeigler [FYI] parker.linn, luciano.ferraro, natalia.miekina, bill.colby #tests 28.20 editor [CL 30595539 by gabriel pereyra in ue5-main branch] --- .../GameplayTags/Private/GameplayTagsManager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp b/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp index d62d8a76233d..f851df8e4c16 100644 --- a/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp +++ b/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp @@ -1584,7 +1584,20 @@ FString UGameplayTagsManager::StaticGetCategoriesMetaFromPropertyHandle(TSharedP } } } - PropertyHandle = PropertyHandle->GetParentHandle(); + + TSharedPtr ParentHandle = PropertyHandle->GetParentHandle(); + + if (ParentHandle.IsValid()) + { + /** Check if the parent handle's base class is of the same class. It's possible the current child property is from a subobject which in that case we probably want to ignore + * any meta category restrictions coming from any parent properties. A subobject's gameplay tag property without any declared meta categories should stay that way. */ + if (PropertyHandle->GetOuterBaseClass() != ParentHandle->GetOuterBaseClass()) + { + break; + } + } + + PropertyHandle = ParentHandle; } return Categories;