From c69689ab5a8127e98ca35361ae2089e3147da460 Mon Sep 17 00:00:00 2001 From: keptsecret Date: Sun, 3 Apr 2022 11:22:01 -0400 Subject: [PATCH] fix unable to change directory in user access mode --- core/os/dir_access.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index ad8bf423ef9..e1dbea28d23 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -249,6 +249,12 @@ DirAccess *DirAccess::create(AccessType p_access) { DirAccess *da = create_func[p_access] ? create_func[p_access]() : nullptr; if (da) { da->_access_type = p_access; + + if (p_access == ACCESS_RESOURCES) { + da->change_dir("res://"); + } else if (p_access == ACCESS_USERDATA) { + da->change_dir("user://"); + } } return da;