fix: if not addedToPhysics on destroy body will be undefined

This commit is contained in:
cha0s 2019-04-14 16:06:11 -05:00
parent 271d71c5fc
commit 883837006f

View File

@ -50,7 +50,7 @@ export class Physical extends decorate(Trait) {
} }
removeFromWorld() { removeFromWorld() {
if (this._world) { if (this._world && this._body) {
this._world.removeBody(this._body); this._world.removeBody(this._body);
} }
this._body = undefined; this._body = undefined;