You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Use C++ iterators for Lists in many situations
This commit is contained in:
@@ -447,8 +447,7 @@ Variant CreateDialog::instance_selected() {
|
||||
List<PropertyInfo> pinfo;
|
||||
((Object *)obj)->get_property_list(&pinfo);
|
||||
|
||||
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
|
||||
PropertyInfo pi = E->get();
|
||||
for (PropertyInfo &pi : pinfo) {
|
||||
if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
|
||||
Object *prop = ClassDB::instantiate(pi.class_name);
|
||||
((Object *)obj)->set(pi.name, prop);
|
||||
|
||||
Reference in New Issue
Block a user