mirror of https://github.com/godotengine/godot
Fix SoftBody3D pinned points breaking when reloading scene
(cherry picked from commit bde8c5977b)
This commit is contained in:
parent
d915947f3d
commit
acba31b746
|
|
@ -218,7 +218,13 @@ bool SoftBody3D::_set_property_pinned_points_attachment(int p_item, const String
|
||||||
|
|
||||||
if ("spatial_attachment_path" == p_what) {
|
if ("spatial_attachment_path" == p_what) {
|
||||||
PinnedPoint *w = pinned_points.ptrw();
|
PinnedPoint *w = pinned_points.ptrw();
|
||||||
callable_mp(this, &SoftBody3D::_pin_point_deferred).call_deferred(Variant(w[p_item].point_index), true, p_value);
|
|
||||||
|
if (is_inside_tree()) {
|
||||||
|
callable_mp(this, &SoftBody3D::_pin_point_deferred).call_deferred(Variant(w[p_item].point_index), true, p_value);
|
||||||
|
} else {
|
||||||
|
pin_point(w[p_item].point_index, true, p_value);
|
||||||
|
_make_cache_dirty();
|
||||||
|
}
|
||||||
} else if ("offset" == p_what) {
|
} else if ("offset" == p_what) {
|
||||||
PinnedPoint *w = pinned_points.ptrw();
|
PinnedPoint *w = pinned_points.ptrw();
|
||||||
w[p_item].offset = p_value;
|
w[p_item].offset = p_value;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue