diff options
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
-rw-r--r-- | modules/gdscript/gd_script.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 299a7d3e54..d183782864 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -76,16 +76,21 @@ Variant *GDFunction::_get_variant(int p_address,GDInstance *p_instance,GDScript case ADDR_TYPE_CLASS_CONSTANT: { //todo change to index! - GDScript *s=p_script; + GDScript *o=p_script; ERR_FAIL_INDEX_V(address,_global_names_count,NULL); const StringName *sn = &_global_names_ptr[address]; - while(s) { - Map<StringName,Variant>::Element *E=s->constants.find(*sn); - if (E) { - return &E->get(); + while(o) { + GDScript *s=o; + while(s) { + + Map<StringName,Variant>::Element *E=s->constants.find(*sn); + if (E) { + return &E->get(); + } + s=s->_base; } - s=s->_base; + o=o->_owner; } @@ -384,6 +389,8 @@ Variant GDFunction::call(GDInstance *p_instance,const Variant **p_args, int p_ar } } + + } else { GDNativeClass *nc= obj_B->cast_to<GDNativeClass>(); @@ -1154,6 +1161,9 @@ GDFunction::GDFunction() { _stack_size=0; _call_size=0; name="<anonymous>"; +#ifdef DEBUG_ENABLED + _func_cname=NULL; +#endif } @@ -2148,6 +2158,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const { "and", "or", "export", + "assert", 0}; |