Skip to content

Commit

Permalink
Merge pull request #47152 from nekomatata/soft-body-attachment-error-3.3
Browse files Browse the repository at this point in the history
[3.3] Fix spamming errors when SoftBody pinned nodes have no attachment
  • Loading branch information
akien-mga authored Mar 19, 2021
2 parents 15ff752 + 0b51cb7 commit 7696f88
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scene/3d/soft_body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,11 @@ void SoftBody::_reset_points_offsets() {
PoolVector<PinnedPoint>::Write w = pinned_points.write();
for (int i = pinned_points.size() - 1; 0 <= i; --i) {

if (!r[i].spatial_attachment)
w[i].spatial_attachment = Object::cast_to<Spatial>(get_node(r[i].spatial_attachment_path));
if (!r[i].spatial_attachment) {
if (!r[i].spatial_attachment_path.is_empty() && has_node(r[i].spatial_attachment_path)) {
w[i].spatial_attachment = Object::cast_to<Spatial>(get_node(r[i].spatial_attachment_path));
}
}

if (!r[i].spatial_attachment)
continue;
Expand Down

0 comments on commit 7696f88

Please sign in to comment.