Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/OvEditor/include/OvEditor/Core/EditorActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ namespace OvEditor::Core
void CopyActor(OvCore::ECS::Actor& p_actor);

/**
* Paste the copied actor, optionally as a child of the given parent
* Paste the copied actor next to the given actor (same parent), or at root if null
* @param p_parent
*/
void PasteActor(OvCore::ECS::Actor* p_parent = nullptr);
Expand Down
8 changes: 4 additions & 4 deletions Sources/OvEditor/src/OvEditor/Core/EditorActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,11 @@ void OvEditor::Core::EditorActions::PasteActor(OvCore::ECS::Actor* p_parent)
{
auto* destinationParent = p_parent;

// Pasting on the copied actor itself falls back to its current parent,
// preserving the "duplicate-like" behavior by default.
if (destinationParent && destinationParent->GetGUID() == copiedActor->GetGUID())
// Pasted actors are always inserted next to the target actor (same parent),
// never as children.
if (destinationParent)
{
destinationParent = copiedActor->GetParent();
destinationParent = destinationParent->GetParent();
}

DuplicateActor(*copiedActor, destinationParent, true);
Expand Down