Don't test if prefab has itself when testing for overrides
@@ -298,6 +298,9 @@ ecs_type_t copy_from_prefab(
for (i = 0; i < add_count; i ++) {
ecs_entity_t component = add_handles[i];
+
+ /* Nothing to copy if this component is the prefab itself */
+ if (component != prefab) {
void *prefab_ptr = get_row_ptr(
prefab_table->type, prefab_table->columns,
row.index, component);
@@ -329,6 +332,7 @@ ecs_type_t copy_from_prefab(
}
}
}
+ }
/* Recursively search through prefabs */
entity_type = row.type_id;
