mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 17:41:19 +00:00
fixed unable to change directory in user access mode
This commit is contained in:
parent
c9d0523302
commit
664c461d28
1 changed files with 8 additions and 0 deletions
|
|
@ -250,6 +250,14 @@ 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;
|
||||||
|
|
||||||
|
// for ACCESS_RESOURCES and ACCESS_FILESYSTEM, current_dir already defaults to where game was started
|
||||||
|
// in case current directory is force changed elsewhere for ACCESS_RESOURCES
|
||||||
|
if (p_access == ACCESS_RESOURCES) {
|
||||||
|
da->change_dir("res://");
|
||||||
|
} else if (p_access == ACCESS_USERDATA) {
|
||||||
|
da->change_dir("user://");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return da;
|
return da;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue