diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp index 6e8c2e7b4..cd6b156d8 100644 --- a/Source/Engine/Level/Actor.cpp +++ b/Source/Engine/Level/Actor.cpp @@ -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; } diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index d34d66e49..feba73997 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -794,7 +794,7 @@ public: { return (T*)FindActor(T::GetStaticClass(), name); } - + /// /// Tries to find the actor of the given type and tag in this actor hierarchy (checks this actor and all children hierarchy). ///