diff options
author | Andrea Catania <info@andreacatania.com> | 2018-04-06 07:48:30 +0200 |
---|---|---|
committer | Andrea Catania <info@andreacatania.com> | 2018-04-06 07:48:30 +0200 |
commit | 776942981bea7f396ad6416a71e65b6af0cb4dd8 (patch) | |
tree | be216f9fc6325d77ec4bdb632f0fb997c428f9aa /modules/bullet/area_bullet.cpp | |
parent | d2eb731878a4d660dd4a6babaea5967183b8f324 (diff) | |
download | redot-engine-776942981bea7f396ad6416a71e65b6af0cb4dd8.tar.gz |
Fixed physics server area cleaning
Diffstat (limited to 'modules/bullet/area_bullet.cpp')
-rw-r--r-- | modules/bullet/area_bullet.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp index 648919e612..ec78cddb6a 100644 --- a/modules/bullet/area_bullet.cpp +++ b/modules/bullet/area_bullet.cpp @@ -68,7 +68,8 @@ AreaBullet::AreaBullet() : } AreaBullet::~AreaBullet() { - remove_all_overlapping_instantly(); + // Call "remove_all_overlapping_instantly();" is not necessary because the exit + // signal are handled by godot, so just clear the array } void AreaBullet::dispatch_callbacks() { @@ -131,12 +132,13 @@ void AreaBullet::remove_all_overlapping_instantly() { overlappingObjects.clear(); } -void AreaBullet::remove_overlapping_instantly(CollisionObjectBullet *p_object) { +void AreaBullet::remove_overlapping_instantly(CollisionObjectBullet *p_object, bool p_notify) { CollisionObjectBullet *supportObject; for (int i = overlappingObjects.size() - 1; 0 <= i; --i) { supportObject = overlappingObjects[i].object; if (supportObject == p_object) { - call_event(supportObject, PhysicsServer::AREA_BODY_REMOVED); + if (p_notify) + call_event(supportObject, PhysicsServer::AREA_BODY_REMOVED); supportObject->on_exit_area(this); overlappingObjects.remove(i); break; |