Преглед изворни кода

Only print message for `get_modified_time()` failure when in verbose mode

This error message was often displayed for no good reason when PCK
files were loaded in the editor.

Since file modification dates are secondary metadata, it's not
very important if it can't be retrieved successfully anyway.

(cherry picked from commit 5acb8a253e40c8e8f86c2e58f9cc7e1a9a020ccc)
Hugo Locurcio пре 3 година
родитељ
комит
e463d3daca
2 измењених фајлова са 4 додато и 2 уклоњено
  1. 2 1
      drivers/unix/file_access_unix.cpp
  2. 2 1
      drivers/windows/file_access_windows.cpp

+ 2 - 1
drivers/unix/file_access_unix.cpp

@@ -307,7 +307,8 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) {
 	if (!err) {
 		return flags.st_mtime;
 	} else {
-		ERR_FAIL_V_MSG(0, "Failed to get modified time for: " + p_file + ".");
+		print_verbose("Failed to get modified time for: " + p_file + "");
+		return 0;
 	};
 }
 

+ 2 - 1
drivers/windows/file_access_windows.cpp

@@ -323,7 +323,8 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
 	if (rv == 0) {
 		return st.st_mtime;
 	} else {
-		ERR_FAIL_V_MSG(0, "Failed to get modified time for: " + file + ".");
+		print_verbose("Failed to get modified time for: " + p_file + "");
+		return 0;
 	}
 }