Merge pull request #58443 from object71/fix-editor-properties-deleted-by-mistake

This commit is contained in:
Rémi Verschelde 2022-07-27 16:53:26 +02:00 committed by GitHub
commit ba2aa30a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3704,20 +3704,25 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li
added.insert(pi.name); added.insert(pi.name);
r_list.insert_before(insert_here, pi); r_list.insert_before(insert_here, pi);
List<PropertyInfo>::Element *prop_below = bottom->next();
while (prop_below) {
if (prop_below->get() == pi) {
List<PropertyInfo>::Element *to_delete = prop_below;
prop_below = prop_below->next();
r_list.erase(to_delete);
} else {
prop_below = prop_below->next();
}
}
} }
// Script Variables -> NodeA (insert_here) -> A props... -> bottom // Script Variables -> NodeA (insert_here) -> A props... -> bottom
insert_here = category; insert_here = category;
} }
// NodeC -> C props... -> NodeB..C..
if (script_variables) { if (script_variables) {
r_list.erase(script_variables); r_list.erase(script_variables);
List<PropertyInfo>::Element *to_delete = bottom->next();
while (to_delete && !(to_delete->get().usage & PROPERTY_USAGE_CATEGORY)) {
r_list.erase(to_delete);
to_delete = bottom->next();
}
r_list.erase(bottom); r_list.erase(bottom);
} }
} }