You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fixing Issues...
- #672 (default user:// in $HOME/.godot/app_userdata (linux/osx) and $APPDATA/Godot/app_userdata (Windows) - #676 (draw both tiles and octants in order from top to bottom, left to right ) - #686 (unicode escape sequences work now) - #702 (was not a bug, but a test was added to see if bodies went too far away)
This commit is contained in:
@@ -130,35 +130,46 @@ Error DirAccess::make_dir_recursive(String p_dir) {
|
||||
if (p_dir.length() < 1) {
|
||||
return OK;
|
||||
};
|
||||
|
||||
String full_dir;
|
||||
Globals* g = Globals::get_singleton();
|
||||
String cur = normalize_path(g->globalize_path(get_current_dir()));
|
||||
if (cur[cur.length()-1] != '/') {
|
||||
cur = cur + "/";
|
||||
};
|
||||
|
||||
String dir = normalize_path(g->globalize_path(p_dir));
|
||||
if (dir.length() < 1) {
|
||||
return OK;
|
||||
};
|
||||
if (dir[dir.length()-1] != '/') {
|
||||
dir = dir + "/";
|
||||
};
|
||||
if (!p_dir.is_abs_path()) {
|
||||
//append current
|
||||
|
||||
ERR_FAIL_COND_V(dir.find(cur) != 0, FAILED);
|
||||
String cur = normalize_path(g->globalize_path(get_current_dir()));
|
||||
if (cur[cur.length()-1] != '/') {
|
||||
cur = cur + "/";
|
||||
};
|
||||
|
||||
String rel = dir.substr(cur.length(), (dir.length() - cur.length()));
|
||||
full_dir=(cur+"/"+p_dir).simplify_path();
|
||||
} else {
|
||||
//validate and use given
|
||||
String dir = normalize_path(g->globalize_path(p_dir));
|
||||
if (dir.length() < 1) {
|
||||
return OK;
|
||||
};
|
||||
if (dir[dir.length()-1] != '/') {
|
||||
dir = dir + "/";
|
||||
};
|
||||
full_dir=dir;
|
||||
}
|
||||
|
||||
int slices = full_dir.get_slice_count("/");
|
||||
|
||||
int pos = 0;
|
||||
while (pos < rel.length()) {
|
||||
while (pos < full_dir.length()) {
|
||||
|
||||
int n = rel.find("/", pos);
|
||||
int n = full_dir.find("/", pos);
|
||||
if (n < 0) {
|
||||
n = rel.length();
|
||||
n = full_dir.length();
|
||||
};
|
||||
pos = n + 1;
|
||||
|
||||
if (pos > 1) {
|
||||
Error err = make_dir(rel.substr(0, pos -1));
|
||||
String to_create = full_dir.substr(0, pos -1);
|
||||
//print_line("MKDIR: "+to_create);
|
||||
Error err = make_dir(to_create);
|
||||
if (err != OK && err != ERR_ALREADY_EXISTS) {
|
||||
|
||||
ERR_FAIL_V(err);
|
||||
|
||||
Reference in New Issue
Block a user