nothing to see, just a crazy map render mem leak

This commit is contained in:
Skillbert
2024-06-12 00:27:28 +02:00
parent be4adf4e6d
commit 50286edac9

View File

@@ -496,17 +496,18 @@ export class RSMapChunk extends TypedEmitter<{ loaded: RSMapChunkData, changed:
}
addToScene(scene: ThreeJsRenderer) {
this.renderscene = scene;
scene.addSceneElement(this);
for (let i = 0; i < 10; i++) {
let name = `chunk_${this.chunkx}_${this.chunkz}${i == 0 ? "" : `_${i}`}`;
if (!globalThis[name]) {
globalThis[name] = this;
this.globalname = name;
break;
if (this.renderscene == null) {
for (let i = 0; i < 10; i++) {
let name = `chunk_${this.chunkx}_${this.chunkz}${i == 0 ? "" : `_${i}`}`;
if (!globalThis[name]) {
globalThis[name] = this;
this.globalname = name;
break;
}
}
}
this.renderscene = scene;
scene.addSceneElement(this);
}
onModelLoaded() {