Properly update node after clearing shapes in _update_shapes_from_children()
(fix bug causing eg. CircleShape2D.set_radius to generate multiple shapes)
This commit is contained in:
parent
f1f3468f70
commit
3eba84e1d7
2 changed files with 4 additions and 4 deletions
|
@ -32,14 +32,14 @@
|
||||||
|
|
||||||
void CollisionObject2D::_update_shapes_from_children() {
|
void CollisionObject2D::_update_shapes_from_children() {
|
||||||
|
|
||||||
shapes.resize(0);
|
shapes.clear();
|
||||||
for(int i=0;i<get_child_count();i++) {
|
for(int i=0;i<get_child_count();i++) {
|
||||||
|
|
||||||
Node* n = get_child(i);
|
Node* n = get_child(i);
|
||||||
n->call("_add_to_collision_object",this);
|
n->call("_add_to_collision_object",this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _update_shapes();
|
_update_shapes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollisionObject2D::_notification(int p_what) {
|
void CollisionObject2D::_notification(int p_what) {
|
||||||
|
|
|
@ -31,14 +31,14 @@
|
||||||
#include "scene/scene_string_names.h"
|
#include "scene/scene_string_names.h"
|
||||||
void CollisionObject::_update_shapes_from_children() {
|
void CollisionObject::_update_shapes_from_children() {
|
||||||
|
|
||||||
shapes.resize(0);
|
shapes.clear();
|
||||||
for(int i=0;i<get_child_count();i++) {
|
for(int i=0;i<get_child_count();i++) {
|
||||||
|
|
||||||
Node* n = get_child(i);
|
Node* n = get_child(i);
|
||||||
n->call("_add_to_collision_object",this);
|
n->call("_add_to_collision_object",this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _update_shapes();
|
_update_shapes();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollisionObject::_notification(int p_what) {
|
void CollisionObject::_notification(int p_what) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue