From 20f5439a82b225696baac6530e20b3f90b218fd7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 4 Apr 2025 16:24:48 +0200 Subject: [PATCH] Fix TerrainChunk::light_remove_index() not actually remoing lights. --- modules/terraman/world/terrain_chunk.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/terraman/world/terrain_chunk.cpp b/modules/terraman/world/terrain_chunk.cpp index 2403dd2c1..f46db8bf4 100644 --- a/modules/terraman/world/terrain_chunk.cpp +++ b/modules/terraman/world/terrain_chunk.cpp @@ -746,6 +746,10 @@ void TerrainChunk::light_remove_index(const int index) { Ref light = _lights[index]; + _lights.remove(index); + light->set_has_owner_chunk(false); + light->disconnect("light_moved", this, "_on_light_moved"); + TerrainWorld *world = get_voxel_world(); if (ObjectDB::instance_validate(world)) {