Fix infinite loop in DirAccessPack::get_current_dir()
This commit is contained in:
parent
d730ee66a4
commit
5c0188b5c3
1 changed files with 4 additions and 5 deletions
|
@ -440,13 +440,12 @@ Error DirAccessPack::change_dir(String p_dir) {
|
||||||
|
|
||||||
String DirAccessPack::get_current_dir() {
|
String DirAccessPack::get_current_dir() {
|
||||||
|
|
||||||
String p;
|
|
||||||
PackedData::PackedDir *pd = current;
|
PackedData::PackedDir *pd = current;
|
||||||
while (pd->parent) {
|
String p = current->name;
|
||||||
|
|
||||||
if (pd != current)
|
while (pd->parent) {
|
||||||
p = "/" + p;
|
pd = pd->parent;
|
||||||
p = p + pd->name;
|
p = pd->name + "/" + p;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "res://" + p;
|
return "res://" + p;
|
||||||
|
|
Loading…
Reference in a new issue