Main Menu: Allow copying directories from non-Minetest locations (#6095)
authorElijah Duffy <enduffy2014@outlook.com>
Tue, 4 Jul 2017 07:27:29 +0000 (00:27 -0700)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Tue, 4 Jul 2017 07:27:29 +0000 (09:27 +0200)
Allow `core.copy_dir` (main menu API) to copy directories from a
non-Minetest location. The check to disallow copying to non-Minetest
locations is retained.

src/script/lua_api/l_mainmenu.cpp

index 7c86525f6e88288ce11b75c4f9d802d6180774dd..917fea134d5a22f9cf7e6fe0123a2af88d1c0e37 100644 (file)
@@ -813,8 +813,7 @@ int ModApiMainMenu::l_copy_dir(lua_State *L)
        std::string absolute_destination = fs::RemoveRelativePathComponents(destination);
        std::string absolute_source = fs::RemoveRelativePathComponents(source);
 
-       if ((ModApiMainMenu::isMinetestPath(absolute_source)) &&
-                       (ModApiMainMenu::isMinetestPath(absolute_destination))) {
+       if ((ModApiMainMenu::isMinetestPath(absolute_destination))) {
                bool retval = fs::CopyDir(absolute_source,absolute_destination);
 
                if (retval && (!keep_source)) {