Skip to content

Commit

Permalink
Fix error when removing items from a VoxelInstanceLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Aug 10, 2024
1 parent b441fdb commit a78c32e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/source/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion terrain/instancing/voxel_instance_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void VoxelInstanceLibrary::add_item(int p_id, Ref<VoxelInstanceLibraryItem> 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");
Expand Down

0 comments on commit a78c32e

Please sign in to comment.