fix a leak

This commit is contained in:
Adrien MALINGREY 2024-09-26 23:15:15 +02:00
parent ce94604fc0
commit 825fbca97b

View File

@ -200,9 +200,9 @@ class Mino extends THREE.Object3D {
this.rotateOnWorldAxis(this.rotationAngle, delta * this.angularVelocity) this.rotateOnWorldAxis(this.rotationAngle, delta * this.angularVelocity)
if (Math.sqrt(this.position.x * this.position.x + this.position.z * this.position.z) > 40 || this.position.y < -50) { if (Math.sqrt(this.position.x * this.position.x + this.position.z * this.position.z) > 40 || this.position.y < -50) {
this.dispose() this.dispose()
return false
} else {
return true return true
} else {
return false
} }
} }
@ -569,7 +569,7 @@ class Playfield extends THREE.Group {
updateFreedMinoes(delta) { updateFreedMinoes(delta) {
this.freedMinoes.forEach(mino => { this.freedMinoes.forEach(mino => {
if (mino.explode(delta)) this.freedMinoes.delete(this) if (mino.explode(delta)) this.freedMinoes.delete(mino)
}) })
} }