mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Merge pull request #32100 from SaracenOne/gdscript_parent_const_types
Fix const deceleration for inherited scripts above immediate parent
This commit is contained in:
commit
291f408fcf
1 changed files with 21 additions and 14 deletions
|
|
@ -5757,10 +5757,11 @@ GDScriptParser::DataType GDScriptParser::_resolve_type(const DataType &p_source,
|
|||
}
|
||||
}
|
||||
|
||||
// Still look for class constants in parent script
|
||||
// Still look for class constants in parent scripts
|
||||
if (!found && (base_type.kind == DataType::GDSCRIPT || base_type.kind == DataType::SCRIPT)) {
|
||||
Ref<Script> scr = base_type.script_type;
|
||||
ERR_FAIL_COND_V(scr.is_null(), result);
|
||||
while (scr.is_valid()) {
|
||||
Map<StringName, Variant> constants;
|
||||
scr->get_constants(&constants);
|
||||
|
||||
|
|
@ -5780,6 +5781,12 @@ GDScriptParser::DataType GDScriptParser::_resolve_type(const DataType &p_source,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
break;
|
||||
} else {
|
||||
scr = scr->get_base_script();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && !for_completion) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue