Skip to content

Commit

Permalink
Fixed issue where entities that where duplicated got a second editor …
Browse files Browse the repository at this point in the history
…meta component, causing a crash when collapsing scene viewports
  • Loading branch information
Illation committed Nov 28, 2020
1 parent 0917043 commit 1c0fd61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Engine/source/EtEditor/SceneEditor/SceneEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ void SceneEditor::RegisterEcsEvents()

ecs.RegisterOnEntityAdded(fw::T_EntityEventFn([](fw::EcsController& ecs, fw::T_EntityId const entity) -> void
{
if (ecs.HasComponent(entity, EditorMetaComponent::GetTypeIndex()))
{
return; // if the entity was added by duplication it will already have this component
}

EditorMetaComponent comp;
comp.name = FS("Entity_%u", entity);

Expand Down

0 comments on commit 1c0fd61

Please sign in to comment.