mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fixes to constants in scope
This commit is contained in:
parent
6572d51288
commit
f1d3b30a45
2 changed files with 47 additions and 32 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue