mirror of
https://github.com/godotengine/godot.git
synced 2024-11-15 00:23:27 +00:00
Merge pull request #8642 from RandomShaper/fix-pack-get-curr-dir
Fix infinite loop in DirAccessPack::get_current_dir()
This commit is contained in:
commit
e58519eb31
@ -440,13 +440,12 @@ Error DirAccessPack::change_dir(String p_dir) {
|
||||
|
||||
String DirAccessPack::get_current_dir() {
|
||||
|
||||
String p;
|
||||
PackedData::PackedDir *pd = current;
|
||||
while (pd->parent) {
|
||||
String p = current->name;
|
||||
|
||||
if (pd != current)
|
||||
p = "/" + p;
|
||||
p = p + pd->name;
|
||||
while (pd->parent) {
|
||||
pd = pd->parent;
|
||||
p = pd->name + "/" + p;
|
||||
}
|
||||
|
||||
return "res://" + p;
|
||||
|
Loading…
Reference in New Issue
Block a user