From 521b1803521f2de86e76c8414d0f282231745573 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Thu, 21 Sep 2023 18:56:45 -0500 Subject: [PATCH] Fix issue with copying and poasting in same folder. --- Source/Editor/Windows/ContentWindow.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 2628735eb..285302d03 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -722,7 +722,12 @@ namespace FlaxEditor.Windows { var item = Editor.ContentDatabase.Find(sourcePath); if (item != null) - Editor.ContentDatabase.Copy(item, Path.Combine(CurrentViewFolder.Path, item.FileName)); + { + var newPath = StringUtils.NormalizePath(Path.Combine(CurrentViewFolder.Path, item.FileName)); + if (sourcePath.Equals(newPath)) + newPath = GetClonedAssetPath(item); + Editor.ContentDatabase.Copy(item, newPath); + } else importFiles.Add(sourcePath); }