diff --git a/doc/source/changelog.md b/doc/source/changelog.md index 2b464ec50..4baa3ba99 100644 --- a/doc/source/changelog.md +++ b/doc/source/changelog.md @@ -33,6 +33,7 @@ Primarily developped with Godot 4.3. - Fixed slow loading when the database path contains `res://` or `user://` - Fixed crash if the database has an invalid path and `flush()` is called after `set_key_cache_enabled(true)` - `VoxelInstancer`: Fixed instances with LOD > 0 were generated on `VoxelTerrain` even though LOD isn't supported (ending up in weird positions). No instances should generate. + - `VoxelInstanceLibrary`: Fixed `Assertion failed: "p_id < 0 || p_id >= MAX_ID" is false` when removing items from a VoxelInstanceLibrary - `VoxelMeshSDF`: Fixed error in the editor when trying to visualize the last slice (which turns out to be off by 1) - `VoxelModifierMesh`: - Fixed setting `isolevel` had no effect diff --git a/terrain/instancing/voxel_instance_library.cpp b/terrain/instancing/voxel_instance_library.cpp index 12e87a237..005f2d6de 100644 --- a/terrain/instancing/voxel_instance_library.cpp +++ b/terrain/instancing/voxel_instance_library.cpp @@ -51,7 +51,7 @@ void VoxelInstanceLibrary::add_item(int p_id, Ref item } void VoxelInstanceLibrary::remove_item(int p_id) { - ZN_ASSERT_RETURN(p_id < 0 || p_id >= MAX_ID); + ZN_ASSERT_RETURN(p_id >= 0 && p_id < MAX_ID); const unsigned int id = p_id; auto it = _items.find(id); ERR_FAIL_COND_MSG(it == _items.end(), "Cannot remove unregistered item");