mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 03:21:25 +00:00
Fix issue with get_current_dir() returning the wrong path on Android
This commit is contained in:
parent
502a6a7cfa
commit
b5e1096c61
2 changed files with 15 additions and 0 deletions
|
|
@ -134,6 +134,20 @@ String DirAccessJAndroid::get_drive(int p_drive) {
|
|||
}
|
||||
}
|
||||
|
||||
String DirAccessJAndroid::get_current_dir() {
|
||||
String base = _get_root_path();
|
||||
String bd = current_dir;
|
||||
if (base != "") {
|
||||
bd = current_dir.replace_first(base, "");
|
||||
}
|
||||
|
||||
if (bd.begins_with("/")) {
|
||||
return _get_root_string() + bd.substr(1, bd.length());
|
||||
} else {
|
||||
return _get_root_string() + bd;
|
||||
}
|
||||
}
|
||||
|
||||
Error DirAccessJAndroid::change_dir(String p_dir) {
|
||||
String new_dir = get_absolute_path(p_dir);
|
||||
if (new_dir == current_dir) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue