Skip to content

Commit

Permalink
Fix crash when adding elements to VoxelBlockyTypeLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Jun 15, 2024
1 parent 3a9f3d1 commit f7b9af9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/godot/core/typed_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ inline void copy_to(std::vector<Ref<T>, TAllocator> &dst, const TypedArray<T> &s
template <typename T, typename TAllocator>
inline void copy_range_to(std::vector<Ref<T>, TAllocator> &dst, const TypedArray<T> &src, int from, int to) {
ZN_ASSERT(from >= 0 && from < src.size());
ZN_ASSERT(to >= 0 && to < src.size());
ZN_ASSERT(to >= 0 && to <= src.size());
ZN_ASSERT(from <= to);
dst.resize(src.size());
const unsigned int len = to - from;
dst.resize(len);
for (int i = from; i < to; ++i) {
dst[i] = src[i];
dst[i - from] = src[i];
}
}

Expand Down

0 comments on commit f7b9af9

Please sign in to comment.