Ver código fonte

Merge pull request #3225 from RaananW/small-physics-fix

Do not init physics body if impostor is disposed.
Raanan Weber 7 anos atrás
pai
commit
e7815e77fe
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      src/Physics/babylon.physicsImpostor.ts

+ 1 - 1
src/Physics/babylon.physicsImpostor.ts

@@ -157,7 +157,7 @@ module BABYLON {
             this._physicsEngine.removeImpostor(this);
             this._physicsEngine.removeImpostor(this);
             this.physicsBody = null;
             this.physicsBody = null;
             this._parent = this._parent || this._getPhysicsParent();
             this._parent = this._parent || this._getPhysicsParent();
-            if (!this.parent || this._options.ignoreParent) {
+            if (!this._isDisposed && (!this.parent || this._options.ignoreParent)) {
                 this._physicsEngine.addImpostor(this);
                 this._physicsEngine.addImpostor(this);
             }
             }
         }
         }