From 1d970cd6ca9400eec16d4b11b291d93f331fc273 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 1 Jul 2023 19:21:35 +0200 Subject: [PATCH] Fix dropping files from res:// to res:// --- editor/filesystem_dock.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index dd8fde496f4..1ff68b7d367 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2617,8 +2617,10 @@ void FileSystemDock::drop_data_fw(const Point2 &p_point, const Variant &p_data, if (!to_dir.is_empty()) { Vector fnames = drag_data["files"]; to_move.clear(); + String target_dir = to_dir == "res://" ? to_dir : to_dir.trim_suffix("/"); + for (int i = 0; i < fnames.size(); i++) { - if (fnames[i].trim_suffix("/").get_base_dir() != to_dir.trim_suffix("/")) { + if (fnames[i].trim_suffix("/").get_base_dir() != target_dir) { to_move.push_back(FileOrFolder(fnames[i], !fnames[i].ends_with("/"))); } }