mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
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
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user