Make IsAssetOrNotBlueprint once again always available

Fix checks against whether something is not a blueprint to use IsNative which works in cooked builds
[CODEREVIEW] Patrick.Enfedaque
#jira
#rnx

#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 18800226 via CL 18800791 via CL 18800932 via CL 18802762 via CL 18821550
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18821637 by marc audy in ue5-main branch]
This commit is contained in:
marc audy
2022-02-02 01:46:41 -05:00
parent 0c003430d8
commit e43f761a9c
2 changed files with 3 additions and 10 deletions

View File

@@ -715,12 +715,10 @@ void UFoliageType::PostLoad()
}
}
#if WITH_EDITOR
bool UFoliageType::IsNotAssetOrBlueprint() const
{
return IsAsset() == false && Cast<UBlueprint>(GetClass()->ClassGeneratedBy) == nullptr;
return IsAsset() == false && GetClass()->IsNative();
}
#endif
FVector UFoliageType::GetRandomScale() const
{
@@ -2951,12 +2949,7 @@ UFoliageType* AInstancedFoliageActor::GetLocalFoliageTypeForSource(const UObject
UFoliageType* FoliageType = Pair.Key;
// Check that the type is neither an asset nor blueprint instance
// ClassGeneratedBy TODO: This is wrong in cooked builds
if (FoliageType && FoliageType->GetSource() == InSource && !FoliageType->IsAsset()
#if WITH_EDITORONLY_DATA
&& !FoliageType->GetClass()->ClassGeneratedBy
#endif
)
if (FoliageType && FoliageType->GetSource() == InSource && !FoliageType->IsAsset() && FoliageType->GetClass()->IsNative())
{
ReturnType = FoliageType;
Info = &*Pair.Value;

View File

@@ -112,10 +112,10 @@ class UFoliageType : public UObject
virtual void Serialize(FArchive& Ar) override;
virtual void PostLoad() override;
virtual bool IsNotAssetOrBlueprint() const;
FOLIAGE_API FVector GetRandomScale() const;
#if WITH_EDITOR
virtual bool IsNotAssetOrBlueprint() const;
virtual void SetSource(UObject* InSource) PURE_VIRTUAL(UFoliageType::SetSource, );
virtual void UpdateBounds() {}