You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Fix incorrect debug check for setters
the check read the return type of the setter, which doesn't exist and lead to a segmentation fault. Now we check the first function parameter. Probably a bad copy/paste of the getter case
This commit is contained in:
@@ -980,7 +980,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class) {
|
|||||||
has_valid_setter = true;
|
has_valid_setter = true;
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
if (member.variable->datatype.builtin_type == Variant::INT && setter_function->return_type->datatype.builtin_type == Variant::FLOAT) {
|
if (member.variable->datatype.builtin_type == Variant::FLOAT && setter_function->parameters[0]->datatype.builtin_type == Variant::INT) {
|
||||||
parser->push_warning(member.variable, GDScriptWarning::NARROWING_CONVERSION);
|
parser->push_warning(member.variable, GDScriptWarning::NARROWING_CONVERSION);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user