From 86253cbdfe0410ad4d50c2051036b51fb01ea16d Mon Sep 17 00:00:00 2001 From: punto- Date: Mon, 6 Jun 2016 23:40:50 -0300 Subject: Revert "Fix implicit GDScript Reference inheritance" --- modules/gdscript/gd_compiler.cpp | 6 ------ modules/gdscript/gd_script.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'modules/gdscript') diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index 072c53fb9f..d51f1a4ddc 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -1588,12 +1588,6 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa } - } else { - // without extends, implicitly extend Reference - int native_idx = GDScriptLanguage::get_singleton()->get_global_map()["Reference"]; - native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx]; - ERR_FAIL_COND_V(native.is_null(), ERR_BUG); - p_script->native=native; } diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 12fc36d8c1..dcd0641f76 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -145,8 +145,11 @@ Variant GDScript::_new(const Variant** p_args,int p_argcount,Variant::CallError& _baseptr=_baseptr->_base; } - ERR_FAIL_COND_V(_baseptr->native.is_null(), Variant()); - owner=_baseptr->native->instance(); + if (_baseptr->native.ptr()) { + owner=_baseptr->native->instance(); + } else { + owner=memnew( Reference ); //by default, no base means use reference + } Reference *r=owner->cast_to(); if (r) { -- cgit v1.2.3