Smoke test: In collections, log an error if reserve() is called with a number smaller than the current size. Don't log an error if it is called with a number smaller than the current capacity.

This commit is contained in:
Lukas Tenbrink 2025-04-11 14:49:49 +02:00
parent 1696ab0cb6
commit 7c37188ca1
7 changed files with 16 additions and 13 deletions

View file

@ -260,7 +260,6 @@ int64_t AStar3D::get_point_capacity() const {
void AStar3D::reserve_space(int64_t p_num_nodes) {
ERR_FAIL_COND_MSG(p_num_nodes <= 0, vformat("New capacity must be greater than 0, new was: %d.", p_num_nodes));
ERR_FAIL_COND_MSG((uint32_t)p_num_nodes < points.get_capacity(), vformat("New capacity must be greater than current capacity: %d, new was: %d.", points.get_capacity(), p_num_nodes));
points.reserve(p_num_nodes);
}