fix unable to change directory in user access mode

(cherry picked from commit c69689ab5a)
This commit is contained in:
keptsecret 2022-04-03 11:22:01 -04:00 committed by Rémi Verschelde
parent 3680cfde86
commit b95221fb0a
1 changed files with 6 additions and 0 deletions

View File

@ -249,6 +249,12 @@ DirAccess *DirAccess::create(AccessType p_access) {
DirAccess *da = create_func[p_access] ? create_func[p_access]() : nullptr; DirAccess *da = create_func[p_access] ? create_func[p_access]() : nullptr;
if (da) { if (da) {
da->_access_type = p_access; 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; return da;