Skip to content

Commit 2c80778

Browse files
committed
Merge pull request phaserjs#251 from cocoademon/physics_self_collide_fix
Don’t test self-collisions
2 parents 10f4bc7 + b48669d commit 2c80778

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/physics/arcade/ArcadePhysics.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,12 @@ Phaser.Physics.Arcade.prototype = {
748748
* @returns {boolean} Returns true if the bodies were separated, otherwise false.
749749
*/
750750
separate: function (body1, body2) {
751-
752-
this._result = (this.separateX(body1, body2) || this.separateY(body1, body2));
753-
751+
if(body1 !== body2)
752+
{
753+
this._result = (this.separateX(body1, body2) || this.separateY(body1, body2));
754+
} else {
755+
this._result = false;
756+
}
754757
},
755758

756759
/**

0 commit comments

Comments
 (0)