Fix renaming files to same name with different case

This commit is contained in:
stefnotch
2020-12-20 18:00:14 +01:00
parent 7e6b236661
commit 0da02b99cc
2 changed files with 1 additions and 7 deletions

View File

@@ -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);

View File

@@ -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;