Simplify code #1949

This commit is contained in:
Wojtek Figat
2024-02-18 20:16:20 +01:00
parent 0d6f85ba6c
commit 9335925b48
2 changed files with 4 additions and 9 deletions

View File

@@ -1358,16 +1358,11 @@ bool Actor::IsPrefabRoot() const
Actor* Actor::GetPrefabRoot()
{
if (!this->HasPrefabLink())
{
return NULL;
}
if (!HasPrefabLink())
return nullptr;
Actor* result = this;
while (!result == NULL && !result->IsPrefabRoot())
{
while (result && !result->IsPrefabRoot())
result = result->GetParent();
}
return result;
}

View File

@@ -794,7 +794,7 @@ public:
{
return (T*)FindActor(T::GetStaticClass(), name);
}
/// <summary>
/// Tries to find the actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy).
/// </summary>