From c01ad67818a45525aa7e22a005ca45075b63ec4d Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Thu, 16 Nov 2017 15:17:17 +0100 Subject: [PATCH] Update: CC - Before Render - Moorcow (plccpu9dx0.js) 147 bytes modified --- plccpu9dx0.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plccpu9dx0.js b/plccpu9dx0.js index 175063f..e849323 100644 --- a/plccpu9dx0.js +++ b/plccpu9dx0.js @@ -268,10 +268,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } - this.kill = function(enemy) { - /** - * We only remove the things we cloned - */ + this.kill = function(enemy) { + /** + * We only remove the things we cloned + */ GameLib.Event.Emit( GameLib.Event.REMOVE_COMPONENT, { @@ -286,6 +286,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } ); + /** + * Also dispose of the THREE.js objects + */ + enemy.mesh.instance.geometry.dispose(); + enemy.mesh.instance.material.dispose(); + if (enemy.smokeParticleEngine) { enemy.smokeParticleEngine.remove(); enemy.smokeParticleEngine = null;