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

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;