Fix "File must be opened" error with File.open()

This commit is contained in:
nova++ 2022-04-12 23:51:32 -04:00 committed by Nova
parent 895f2a21f4
commit 1a3cb23955

View File

@ -1072,7 +1072,6 @@ Error File::open_compressed(const String &p_path, ModeFlags p_mode_flags, Compre
} }
Error File::open(const String &p_path, ModeFlags p_mode_flags) { Error File::open(const String &p_path, ModeFlags p_mode_flags) {
close();
Error err; Error err;
f = FileAccess::open(p_path, p_mode_flags, &err); f = FileAccess::open(p_path, p_mode_flags, &err);
if (f.is_valid()) { if (f.is_valid()) {