Calling P2.Body.destroy or ArcadePhysics.Body.destroy wouldn't null the parent sprite body, causing it to error in the next update (thanks @jonathanhooker #1077)

This commit is contained in:
photonstorm 2014-08-28 03:44:02 +01:00
parent ec687868de
commit 0f207c47a7
3 changed files with 3 additions and 1 deletions

View file

@ -125,6 +125,7 @@ Version 2.1.0 - "Cairhien" - -in development-
* Debug.cameraInfo no longer crashes if the camera bounds are nulled (thanks @wayfu #1143)
* Camera.setBoundsToWorld no longer crashes if the camera bounds are nulled (thanks @wayfu #1143)
* Fixed the resolution uniform type in the SampleFilter (thanks @VictoryRice #1137)
* Calling P2.Body.destroy or ArcadePhysics.Body.destroy wouldn't null the parent sprite body, causing it to error in the next update (thanks @jonathanhooker #1077)
### p2.js 0.6.0 Changes and New Features

View file

@ -533,6 +533,7 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
destroy: function () {
this.sprite.body = null;
this.sprite = null;
},

View file

@ -774,7 +774,7 @@ Phaser.Physics.P2.Body.prototype = {
}
this.debugBody = null;
this.sprite.body = null;
this.sprite = null;
},