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:
Fabio Alessandrelli 2015-11-30 21:04:24 +01:00
parent f1f3468f70
commit 3eba84e1d7
2 changed files with 4 additions and 4 deletions

View File

@ -32,14 +32,14 @@
void CollisionObject2D::_update_shapes_from_children() {
shapes.resize(0);
shapes.clear();
for(int i=0;i<get_child_count();i++) {
Node* n = get_child(i);
n->call("_add_to_collision_object",this);
}
// _update_shapes();
_update_shapes();
}
void CollisionObject2D::_notification(int p_what) {

View File

@ -31,14 +31,14 @@
#include "scene/scene_string_names.h"
void CollisionObject::_update_shapes_from_children() {
shapes.resize(0);
shapes.clear();
for(int i=0;i<get_child_count();i++) {
Node* n = get_child(i);
n->call("_add_to_collision_object",this);
}
// _update_shapes();
_update_shapes();
}
void CollisionObject::_notification(int p_what) {