Skip to content

Commit cd3742f

Browse files
Corrected intersects fuction
Added protection against incorrect handling collisions. Clashes with the body itself will not be processed.
1 parent 027725e commit cd3742f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/physics/arcade/World.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,8 @@ Phaser.Physics.Arcade.prototype = {
986986
*/
987987
intersects: function (body1, body2) {
988988

989+
if (body1 === body2) return false;
990+
989991
// Rect vs. Rect
990992
if (body1.right <= body2.position.x)
991993
{

0 commit comments

Comments
 (0)