diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs index 01f8bf8d0..f0fa8022a 100644 --- a/Source/Editor/Modules/ContentDatabaseModule.cs +++ b/Source/Editor/Modules/ContentDatabaseModule.cs @@ -464,12 +464,6 @@ namespace FlaxEditor.Modules MessageBox.Show("Cannot move folder. Target location already exists."); return; } - if (!item.IsFolder && File.Exists(newPath)) - { - // Error - MessageBox.Show("Cannot move file. Target location already exists."); - return; - } // Find target parent var newDirPath = Path.GetDirectoryName(newPath); diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp index 78d0ff1d6..ed2fba1dc 100644 --- a/Source/Engine/Content/Content.cpp +++ b/Source/Engine/Content/Content.cpp @@ -574,7 +574,7 @@ bool Content::RenameAsset(const StringView& oldPath, const StringView& newPath) Asset* newAsset = GetAsset(newPath); // Validate name - if (newAsset != nullptr || FileSystem::FileExists(newPath)) + if (newAsset != nullptr && newAsset != oldAsset) { LOG(Error, "Invalid name '{0}' when trying to rename '{1}'.", newPath, oldPath); return true;