Skip to content

Commit

Permalink
Merge pull request #78549 from dalexeev/gds-fix-prop-list-name-check
Browse files Browse the repository at this point in the history
GDScript: Remove unnecessary name check in `_get_property_list()`
  • Loading branch information
YuriSizov authored Jun 22, 2023
2 parents 57e61db + 84c8946 commit e74bf83
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1747,11 +1747,10 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
Dictionary d = arr[i];
ERR_CONTINUE(!d.has("name"));
ERR_CONTINUE(!d.has("type"));

PropertyInfo pinfo;
pinfo.type = Variant::Type(d["type"].operator int());
ERR_CONTINUE(pinfo.type < 0 || pinfo.type >= Variant::VARIANT_MAX);
pinfo.name = d["name"];
ERR_CONTINUE(pinfo.name.is_empty());
pinfo.type = Variant::Type(d["type"].operator int());
if (d.has("hint")) {
pinfo.hint = PropertyHint(d["hint"].operator int());
}
Expand All @@ -1765,6 +1764,9 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
pinfo.class_name = d["class_name"];
}

ERR_CONTINUE(pinfo.name.is_empty() && (pinfo.usage & PROPERTY_USAGE_STORAGE));
ERR_CONTINUE(pinfo.type < 0 || pinfo.type >= Variant::VARIANT_MAX);

props.push_back(pinfo);
}
}
Expand Down

0 comments on commit e74bf83

Please sign in to comment.