Merge pull request #8641 from RandomShaper/fix-pack-get-curr-dir-2.1

Fix infinite loop in DirAccessPack::get_current_dir() (2.1)
This commit is contained in:
Rémi Verschelde 2017-05-05 23:02:17 +02:00 committed by GitHub
commit 056be08ab4

View File

@ -438,13 +438,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;