mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Merge pull request #925 from jonkelling/dev
Fix for issue #917, Physics.P2.Body#addToWorld
This commit is contained in:
commit
a425470f41
1 changed files with 11 additions and 0 deletions
|
@ -720,6 +720,17 @@ Phaser.Physics.P2.Body.prototype = {
|
|||
*/
|
||||
addToWorld: function () {
|
||||
|
||||
if (this.game.physics.p2._toRemove)
|
||||
{
|
||||
for (var i = 0; i < this.game.physics.p2._toRemove.length; i++)
|
||||
{
|
||||
if (this.game.physics.p2._toRemove[i] === this)
|
||||
{
|
||||
this.game.physics.p2._toRemove.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.data.world !== this.game.physics.p2.world)
|
||||
{
|
||||
this.game.physics.p2.addBody(this);
|
||||
|
|
Loading…
Reference in a new issue