summaryrefslogtreecommitdiff
path: root/modules/bullet/area_bullet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bullet/area_bullet.cpp')
-rw-r--r--modules/bullet/area_bullet.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp
index 79d8e252f0..01f068780d 100644
--- a/modules/bullet/area_bullet.cpp
+++ b/modules/bullet/area_bullet.cpp
@@ -164,7 +164,7 @@ void AreaBullet::main_shape_changed() {
btGhost->setCollisionShape(get_main_shape());
}
-void AreaBullet::reload_body() {
+void AreaBullet::do_reload_body() {
if (space) {
space->remove_area(this);
space->add_area(this);
@@ -174,16 +174,19 @@ void AreaBullet::reload_body() {
void AreaBullet::set_space(SpaceBullet *p_space) {
// Clear the old space if there is one
if (space) {
+ overlappingObjects.clear();
isScratched = false;
// Remove this object form the physics world
+ space->unregister_collision_object(this);
space->remove_area(this);
}
space = p_space;
if (space) {
- space->add_area(this);
+ space->register_collision_object(this);
+ reload_body();
}
}