Skip to content

Commit a425470

Browse files
committed
Merge pull request phaserjs#925 from jonkelling/dev
Fix for issue phaserjs#917, Physics.P2.Body#addToWorld
2 parents d2fc425 + 36d7069 commit a425470

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/physics/p2/Body.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,17 @@ Phaser.Physics.P2.Body.prototype = {
720720
*/
721721
addToWorld: function () {
722722

723+
if (this.game.physics.p2._toRemove)
724+
{
725+
for (var i = 0; i < this.game.physics.p2._toRemove.length; i++)
726+
{
727+
if (this.game.physics.p2._toRemove[i] === this)
728+
{
729+
this.game.physics.p2._toRemove.splice(i, 1);
730+
}
731+
}
732+
}
733+
723734
if (this.data.world !== this.game.physics.p2.world)
724735
{
725736
this.game.physics.p2.addBody(this);

0 commit comments

Comments
 (0)