Skip to content

Commit a78c32e

Browse files
committed
Fix error when removing items from a VoxelInstanceLibrary
1 parent b441fdb commit a78c32e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Primarily developped with Godot 4.3.
3333
- Fixed slow loading when the database path contains `res://` or `user://`
3434
- Fixed crash if the database has an invalid path and `flush()` is called after `set_key_cache_enabled(true)`
3535
- `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.
36+
- `VoxelInstanceLibrary`: Fixed `Assertion failed: "p_id < 0 || p_id >= MAX_ID" is false` when removing items from a VoxelInstanceLibrary
3637
- `VoxelMeshSDF`: Fixed error in the editor when trying to visualize the last slice (which turns out to be off by 1)
3738
- `VoxelModifierMesh`:
3839
- Fixed setting `isolevel` had no effect

terrain/instancing/voxel_instance_library.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void VoxelInstanceLibrary::add_item(int p_id, Ref<VoxelInstanceLibraryItem> item
5151
}
5252

5353
void VoxelInstanceLibrary::remove_item(int p_id) {
54-
ZN_ASSERT_RETURN(p_id < 0 || p_id >= MAX_ID);
54+
ZN_ASSERT_RETURN(p_id >= 0 && p_id < MAX_ID);
5555
const unsigned int id = p_id;
5656
auto it = _items.find(id);
5757
ERR_FAIL_COND_MSG(it == _items.end(), "Cannot remove unregistered item");

0 commit comments

Comments
 (0)