Преглед на файлове

Merge pull request #40528 from nathanfranke/fix-directory-make-dir

Fix Directory make_dir and make_dir_recursive
Rémi Verschelde преди 5 години
родител
ревизия
84fe3d7df5
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      core/bind/core_bind.cpp

+ 2 - 2
core/bind/core_bind.cpp

@@ -1690,7 +1690,7 @@ String _Directory::get_current_dir() {
 }
 
 Error _Directory::make_dir(String p_dir) {
-	ERR_FAIL_COND_V_MSG(!is_open(), ERR_UNCONFIGURED, "Directory must be opened before use.");
+	ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory is not configured properly.");
 	if (!p_dir.is_rel_path()) {
 		DirAccess *d = DirAccess::create_for_path(p_dir);
 		Error err = d->make_dir(p_dir);
@@ -1701,7 +1701,7 @@ Error _Directory::make_dir(String p_dir) {
 }
 
 Error _Directory::make_dir_recursive(String p_dir) {
-	ERR_FAIL_COND_V_MSG(!is_open(), ERR_UNCONFIGURED, "Directory must be opened before use.");
+	ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory is not configured properly.");
 	if (!p_dir.is_rel_path()) {
 		DirAccess *d = DirAccess::create_for_path(p_dir);
 		Error err = d->make_dir_recursive(p_dir);