From 71355aaab7eca64bec694918c6b911a412ad17f0 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 24 May 2014 13:25:56 -0300 Subject: -Fixed bug in "extends" --- modules/gdscript/gd_compiler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/gdscript/gd_compiler.cpp') diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 548b10cf1..f1b7ad009 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1321,6 +1321,16 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars if (path!="") { //path (and optionally subclasses) + if (path.is_rel_path()) { + + String 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; + } + path=base.get_base_dir().plus_file(path); + } + script = ResourceLoader::load(path); if (script.is_null()) { _set_error("Could not load base class: "+path,p_class); -- cgit v1.2.3-70-g09d2