Fix infinite loop in DirAccessPack::get_current_dir()

This commit is contained in:
Pedro J. Estébanez 2017-05-04 02:20:53 +02:00
parent d730ee66a4
commit 5c0188b5c3

View File

@ -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;