diff --git a/worldeditor/src/screens/scenecomposer/actions/deleteobjects.cpp b/worldeditor/src/screens/scenecomposer/actions/deleteobjects.cpp index 00e1afc89..2c276b969 100644 --- a/worldeditor/src/screens/scenecomposer/actions/deleteobjects.cpp +++ b/worldeditor/src/screens/scenecomposer/actions/deleteobjects.cpp @@ -72,6 +72,7 @@ void DeleteObjects::redo() { m_cloneCache.clear(); std::list list; + bool isComponent = false; for(auto it : m_objects) { Object *object = Engine::findObject(it); @@ -86,6 +87,7 @@ void DeleteObjects::redo() { } else { Component *component = dynamic_cast(object); if(component) { + isComponent = true; scenes.insert(component->scene()); } } @@ -121,8 +123,10 @@ void DeleteObjects::redo() { } } - m_controller->clear(); - m_controller->selectActors(list); + if(!isComponent) { + m_controller->clear(); + m_controller->selectActors(list); + } for(auto it : m_objects) { Object *object = Engine::findObject(it); @@ -131,6 +135,10 @@ void DeleteObjects::redo() { } } + if(isComponent) { + m_controller->selectActors(list); + } + for(auto it : scenes) { emit m_controller->sceneUpdated(it); }