diff options
| author | Saracen | 2016-04-09 03:17:02 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2016-04-27 08:42:48 +0200 |
| commit | b2b5c495e176209a450dcedc94a7d82292463232 (patch) | |
| tree | 17836d2fcea6108ea0dff5191db0a3c2ffc90d71 /modules/gdscript/gd_compiler.cpp | |
| parent | e367c6cdd838cb8c645c254df9c4e8d0c1846cbc (diff) | |
| download | godot-b2b5c495e176209a450dcedc94a7d82292463232.tar.gz godot-b2b5c495e176209a450dcedc94a7d82292463232.tar.zst godot-b2b5c495e176209a450dcedc94a7d82292463232.zip | |
Diffstat (limited to 'modules/gdscript/gd_compiler.cpp')
| -rw-r--r-- | modules/gdscript/gd_compiler.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 1f0cedf27..d26773ff0 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1421,7 +1421,22 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars if (path.is_rel_path()) { - String base = p_script->get_path(); + String base; + + if (p_owner) { + GDScript *current_class = p_owner; + while (current_class != NULL) { + base=current_class->get_path(); + if (base=="") + current_class = current_class->_owner; + else + break; + } + } + else { + base = p_script->get_path(); + } + if (base=="" || base.is_rel_path()) { _set_error("Could not resolve relative path for parent class: "+path,p_class); return ERR_FILE_NOT_FOUND; |
