Skip to content

Commit 79fd282

Browse files
committed
Added test component protection to EntityRegistry::isParentOf
1 parent ca2b1fb commit 79fd282

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

engine/core/registry/EntityRegistry.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ Entity EntityRegistry::findOldestParent(Entity entity){
252252
bool EntityRegistry::isParentOf(Entity parent, Entity child){
253253
auto transforms = componentManager.getComponentArray<Transform>();
254254

255+
if (!getSignature(parent).test(getComponentId<Transform>()) || !getSignature(child).test(getComponentId<Transform>())) {
256+
return false;
257+
}
258+
255259
size_t index = transforms->getIndex(child);
256260
Entity lastParent = transforms->getComponentFromIndex(index).parent;
257261

0 commit comments

Comments
 (0)