Fix bug in inner class reference, closes #1411

(cherry picked from commit cf6450043d)
This commit is contained in:
Juan Linietsky 2016-06-28 11:15:55 -03:00 committed by Rémi Verschelde
parent eaca35adfe
commit de0b7b871b
1 changed files with 9 additions and 4 deletions

View File

@ -2278,12 +2278,17 @@ bool GDInstance::get(const StringName& p_name, Variant &r_ret) const {
} }
{ {
const Map<StringName,Variant>::Element *E = script->constants.find(p_name);
const GDScript *sl = sptr;
while(sl) {
const Map<StringName,Variant>::Element *E = sl->constants.find(p_name);
if (E) { if (E) {
r_ret=E->get(); r_ret=E->get();
return true; //index found return true; //index found
} }
sl=sl->_base;
}
} }
{ {