fix unable to change directory in user access mode

This commit is contained in:
keptsecret 2022-04-03 11:22:01 -04:00
parent a5f9e1ce18
commit c69689ab5a
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;
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;