Merge pull request #47151 from nekomatata/soft-body-attachment-error

Fix spamming errors when SoftBody pinned nodes have no attachment
This commit is contained in:
Rémi Verschelde 2021-03-19 08:38:27 +01:00 committed by GitHub
commit 67dc067970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -768,7 +768,9 @@ void SoftBody3D::_reset_points_offsets() {
PinnedPoint *w = pinned_points.ptrw();
for (int i = pinned_points.size() - 1; 0 <= i; --i) {
if (!r[i].spatial_attachment) {
w[i].spatial_attachment = Object::cast_to<Node3D>(get_node(r[i].spatial_attachment_path));
if (!r[i].spatial_attachment_path.is_empty() && has_node(r[i].spatial_attachment_path)) {
w[i].spatial_attachment = Object::cast_to<Node3D>(get_node(r[i].spatial_attachment_path));
}
}
if (!r[i].spatial_attachment) {